For loop with running parameter out of struct
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, I would like to run a for loop like this:
for Test.i=1:100 do something end
My intention is to have one struct where all my variables from my quite small script are stored and I don't mess up the workspace of the whole model.
Thanks in advance
0 件のコメント
回答 (2 件)
madhan ravi
2018 年 10 月 24 日
編集済み: madhan ravi
2018 年 10 月 24 日
for i=1:100
Test.x(i)=i ; %an example
Test.y(i)=x.^(i) ;
end
save('mymat.mat',Test)
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!