Can someone help me convert this for loop to a while loop?
v=0;
for n=1:length(i);
v=v+i(n);
end

답변 (1개)

Adam
Adam 2016년 11월 9일

0 개 추천

v = 0;
n = 1;
while n <= length( i )
v = v + i( n );
n = n + 1;
end
Quite why you would want to do this I don't know but anyway...

카테고리

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

태그

질문:

2016년 11월 9일

답변:

2016년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by