How to make the array automatic shift to next column after looping
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hong Wei Tang
le 20 Août 2021
Réponse apportée : Wan Ji
le 20 Août 2021
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.
0 commentaires
Réponse acceptée
Wan Ji
le 20 Août 2021
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!