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!