Saving a result of each loop´into a new vector

조회 수: 2 (최근 30일)
Luiz Bernardo
Luiz Bernardo 2011년 6월 21일
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

채택된 답변

Sean de Wolski
Sean de Wolski 2011년 6월 21일
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?

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by