Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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 !

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 7 de Jun. de 2013
Editada: Azzi Abdelmalek el 7 de Jun. de 2013
Edit
data=[];
for i=1:21
a = handles.models(i).gmm;
b = a.mu';
SV = b(:)';
data=[data;SV]
end
  8 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 7 de Jun. de 2013
data=[];
for i=1:21
a = handles.models(i).gmm;
b = a.mu';
SV = b(:)';
data=[data;SV]
end

Iniciar sesión para comentar.

Más respuestas (1)

Iain
Iain el 7 de Jun. de 2013
array = [];
for i = 1:10
...
array = [array; addthis];
...
end
  3 comentarios
Iain
Iain el 7 de Jun. de 2013
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 el 7 de Jun. de 2013
i got it a while ago with Azzi's help,thanks for your help too

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by