How to make the array automatic shift to next column after looping

I want to output a 8752x1 matrix with looping it 5 times, therefore there are 5 sets of 8752x1 matrix to output. However, I only can output the last looping matrix in the end. What should I do in order to show all matrix instead of just showing last?
Thanks. Have a great day.

 채택된 답변

Wan Ji
Wan Ji 2021년 8월 20일
Use following command
total_five_output = zeros(8752,5);
for i = 1:1:5
% .... % your body to generate output
total_five_output(:,i) = output(:); % output is your 8752x1 matrix with each
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 8월 20일

답변:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by