Save arrays in a structure
29 ビュー (過去 30 日間)
古いコメントを表示
Hi.
I have written an algorithm that computes an array "b" for each ith iteration [i={1,2,3,4}], and I would like to save those arrays in a structure called "A".
How to save those arrays in the structure "A" where its elements are function of "i", i.e, A = {b1, b2,b3, b4} and to get b1 for instance, one would have to type A.b1.
Regards.
2 件のコメント
採用された回答
madhan ravi
2019 年 5 月 15 日
doc cell2struct
3 件のコメント
madhan ravi
2019 年 5 月 16 日
編集済み: madhan ravi
2019 年 5 月 16 日
A=struct; % an example
for k=1:5
A.(sprintf('b%d',k))=rand(5);
end
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!