matlab建立结构数组或转换结构数组的函数是?
发布网友
发布时间:2022-04-25 00:01
我来回答
共1个回答
热心网友
时间:2023-10-16 06:28
s = struct('type',{'big','little'},'color','red','x',{3 4})
使用struct函数,这是例子
S = struct('field1',VALUES1,'field2',VALUES2,...) creates a
structure array with the specified fields and values. The value
arrays VALUES1, VALUES2, etc. must be cell arrays of the same
size, scalar cells or single values. Corresponding elements of the
value arrays are placed into corresponding structure array elements.
The size of the resulting structure is the same size as the value
cell arrays or 1-by-1 if none of the values is a cell.