how to display output of all iteration of for loop in a matrix or even a array

4 ビュー (過去 30 日間)
ritika
ritika 2014 年 2 月 4 日
コメント済み: ritika 2014 年 2 月 4 日
a=[1 2 3 4 5 6 7 8 9 0]
for i=1:2:7
b=a(1,i:i+3)
end
this is the code i hve written,now i want this output in the form of a matrix. can someone help

採用された回答

Thomas
Thomas 2014 年 2 月 4 日
a=[1 2 3 4 5 6 7 8 9 0]
count=1;
for i=1:2:7
b(count,:)=a(1,i:i+3);
count=count+1;
end
b

その他の回答 (0 件)

カテゴリ

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