Basic For Loop problem
1 回表示 (過去 30 日間)
古いコメントを表示
It is not very difficult code but I don't know why I am getting error. The value of the k should be printed like 1, 1, 1, 2, 2, 2, 3, 3, 3, ....... 1000, 1000, 1000 but it does not start from 1, 1, 1. Please help with this very simple question. If I remove a=2+4 and b=a+7 then it is okay.
for k=1:1000
a=2+4;
b=a+7
for i=1:3
k
end
end
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
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!