convert for loop to while
이전 댓글 표시
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
2016년 11월 9일
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에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!