how we write condition in for loop?
1 回表示 (過去 30 日間)
古いコメントを表示
suppose in c language we have a condition like k=0;k<j;k++
how we write this code in matlab?
0 件のコメント
採用された回答
その他の回答 (2 件)
Pruthvi G
2019 年 4 月 3 日
編集済み: Pruthvi G
2019 年 4 月 3 日
Increment of 1
for k = 1:1:j % Increment of 1
% do operations
end
Increment of 2
for k = 1:2:j % Increment of 2
% do operations
end
Decrement from j to 1 in step of 1
for k = j:-1:1 % Decrement of -1
% do operations
end
Please Accept answer if you understood, else ping me for advanced help
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!