Guys, this seems very simple and trivial, but I'm having a great amount of difficult with this
I have this for loop below, how can I write it in the while form?
for k=1:3:9
x=k^2
end

 채택된 답변

per isakson
per isakson 2015년 5월 31일
편집: per isakson 2015년 5월 31일

0 개 추천

Something like this might do it
k = 1;
while k <= 9
x = k^2
k = k+3;
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2015년 5월 31일

댓글:

2015년 5월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by