For loop comand use
이전 댓글 표시
Hi,I want to compute the sum 2 + 4 + 6 + 8 + 10 + : : : + 100 by using For loop . Can anyone here thankfully help me out?
댓글 수: 4
James Tursa
2017년 10월 5일
What have you done so far? What specific problems are you having with your code?
F.O
2017년 10월 5일
편집: James Tursa
2017년 10월 5일
James Tursa
2017년 10월 5일
편집: James Tursa
2017년 10월 5일
Change
total = total + 1;
to
total = total + k; % <-- You need to add the index variable k, not 1 every time
F.O
2017년 10월 6일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 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!