struct array
18 ビュー (過去 30 日間)
古いコメントを表示
I'm attempting to do the following inside a loop:
Name={'Note1','Note2','Note3','Note4'};
Data=struct('Note1',Temp{1,1},'Note2',Temp{1,2},'Note3',...
Temp{1,3},'Note4',Temp{1,4});
Is it possible to do this inside a loop, therefore avoiding to writing each individual field name: Something like the following, although this provides an error: for i=1:4; Data(i)=struct(Name{i},Temp{1,i}); end
I'm thinking that the problem lies with Data(i).
0 件のコメント
採用された回答
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!