How to use nested for loops?
1 回表示 (過去 30 日間)
古いコメントを表示
I am very new to MATLAB, and I have been trying to figure out how to use nested for loops correctly. I want to print out :
1
121
12321
1234321
123454321
what should I do if there are a varying number of columns? Any help would be greatly appreciated.
3 件のコメント
Walter Roberson
2018 年 4 月 10 日
for variable = something : something_else
for another_variable = thing2 : thing3
% do something involving variable and another_variable
end
end
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!