필터 지우기
필터 지우기

How to put a list of different arrays, one below another, to create a new array ?

조회 수: 3 (최근 30일)
What I am asking is similar to this example,
I have y1,y2,y3 manually created and I want my final array to be
data = [y1;y2;y3];
How am i supposed to do the same thing inside a for loop ?
for i=1:10
y = myfunc();
data = ??
end
I hope you understood what I cant do and I sincerely hope this can be done someway.
P.S.: I am aware of allocating memory space for the dynamically created array data
Thanks for your time in advance !

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 7일
편집: Azzi Abdelmalek 2013년 6월 7일
Edit
data=[];
for i=1:21
a = handles.models(i).gmm;
b = a.mu';
SV = b(:)';
data=[data;SV]
end
  댓글 수: 8
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 7일
data=[];
for i=1:21
a = handles.models(i).gmm;
b = a.mu';
SV = b(:)';
data=[data;SV]
end

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

추가 답변 (1개)

Iain
Iain 2013년 6월 7일
array = [];
for i = 1:10
...
array = [array; addthis];
...
end
  댓글 수: 3
Iain
Iain 2013년 6월 7일
It is whatever you want to add to the bottom of the array, whether its a new row, or 15 new rows.
Stamatis Samaras
Stamatis Samaras 2013년 6월 7일
i got it a while ago with Azzi's help,thanks for your help too

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by