How do I convert from a while loop to a for loop?

조회 수: 2 (최근 30일)
Jillian Sweatt
Jillian Sweatt 2015년 11월 4일
답변: James Tursa 2015년 11월 4일
i = 0;
while (i < 110)
fprintf('i = %d\n',i)
i = i + 11;
end

채택된 답변

James Tursa
James Tursa 2015년 11월 4일
for i=0:11:109
fprintf('i = %d\n',i)
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by