repeat many conditions of for loop
3 ビュー (過去 30 日間)
古いコメントを表示
I'm very new Mathlab user. May i know how can I generate for loop with many conditions by using repeat. I have two statement for "for"loop. and the conditions are like (i=1:64, i=1:128, i=256,....). I have to get the result from every condition.(ans1 from i=1:64, ans2 from i=128,...)
0 件のコメント
採用された回答
Walter Roberson
2015 年 10 月 25 日
upper_limits = [64, 128, 256];
for ul_idx = 1 : length(upper_limits)
upper_limit = upper_limits(ul_idx);
for i = 1 : upper_limit
..
end
result(ul_idx) = some calculated result
end
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!