【发布时间】:2013-04-09 14:20:30
【问题描述】:
我有两个带有结构的元胞数组。
示例:
xmlFB = 第 1 至 5 列 [1x1 结构] [1x1 结构] [1x1 结构] [1x1 结构] [1x1 结构]xml链接= 第 1 至 3 列 [1x1 结构] [1x1 结构] [1x1 结构]
xmlFB{1} 答案 =
Param: {[1x1 struct] [1x1 struct]}
InterChartConnection: [1x1 struct]
Tasks: [1x1 struct]
Attributes: [1x1 struct]
xmllink{1}
ans =
Attributes: [1x1 struct]
在“xmllink”中有结构“Attributes”,其中有字段“Name”,其值为“EN1"
并且在结构“Attributes”中的xmlFB中有两个字段“Name”和“Typ”
名称是独一无二的。
我要做的是从“xmllink”中的名称中找到“xmlFB”中的“Typ”。
首先我想做一个循环,但我从 Matlab 中读到了这些 arrayfun/structfun/cellfun 函数。
有没有办法用这些来做到这一点?还是循环更好?
【问题讨论】:
-
请在名称和类型字段中准确指定值的类别和大小。
-
我不确定我是否理解你的意思。但它们都是char和max。是 20 个字符。
-
谢谢,这正是我们所需要的。我基本上要求输出
class和size函数。只是为了确保我的假设是正确的。