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

2 ビュー (過去 30 日間)
Hong Wei Tang
Hong Wei Tang 2021 年 8 月 20 日
回答済み: Wan Ji 2021 年 8 月 20 日
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 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by