MATLAB Answers

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

조회 수: 29(최근 30일)
ritika
ritika 4 Feb 2014
댓글: ritika 4 Feb 2014
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

  댓글 수: 0

댓글을 달려면 로그인하십시오.

채택된 답변

Thomas
Thomas 4 Feb 2014
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개)


Translated by