フィルターのクリア

convert for loop to while

1 回表示 (過去 30 日間)
sam ham
sam ham 2016 年 11 月 9 日
回答済み: Adam 2016 年 11 月 9 日
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 日
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...

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by