Decrementing for loop in MATLAB
古いコメントを表示
Hello everyone,
I am new to MATLAB programming and I want to use a for loop starting with an index 5 and reducing to 1
Example in C++ I can write for int i = 5;i<=1;i--)
how can this be implemented in MATLAB
採用された回答
その他の回答 (2 件)
yagnesh
2012 年 11 月 29 日
5 投票
for i= 5:-1:1 %here we have used reverse for loop to overcome with error statement end
1 件のコメント
dhrumil sheth
2016 年 5 月 25 日
Very Good. It is really helpful for me
It is always a good idea to read the documentation in case of questions:
There you find a corresponding example.
カテゴリ
ヘルプ センター および 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!