how to run iterations?
古いコメントを表示
Please I need help with iterations. For instance, if my Matlab script runs thus:
z=2; z=1+z
What can i do if i am looking to run this a hundred times such that the result from '1+z' is put in place of Z upon every iteration. Thanks
採用された回答
その他の回答 (1 件)
Elvin
2014 年 2 月 6 日
You can try something like this:
z = 0;
for i = 1:100
z = z+i;
end
2 件のコメント
Walter Roberson
2014 年 2 月 6 日
Notice this is "z+i" (lower-case I) not "z+1" (digit one)
Oluyemi Jegede
2014 年 2 月 6 日
カテゴリ
ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!