Saving a result of each loop´into a new vector

3 visualizaciones (últimos 30 días)
Luiz Bernardo
Luiz Bernardo el 21 de Jun. de 2011
Hi, I have a looping where a modulation is done and I need to save (or allocate) the results of each loop into a new collumn vector. How this could be done in matlab ,as each loop has a different results for this modulation .
Thanks
luiz

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 21 de Jun. de 2011
A = zeros(length_of_column,number_of_vectors)
for ii = 1:number_of_vectors
a_result = some_function(stuff(ii));
A(:,ii) = a_result(:);
end
Each column of A will be a result. Also see: why shouldn't I make dozens of variables?

Más respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by