Effacer les filtres
Effacer les filtres

How to concatenate using for loop?

5 vues (au cours des 30 derniers jours)
azarang asadi
azarang asadi le 24 Oct 2021
Modifié(e) : Paul le 24 Oct 2021
Hi,
I'm running a for loop and on every iteration I get a matrix that has 231 columns but different number of rows. I need to concatenate my results vertically and save them to a m by 231 matrix that is concatenated of all for loop results. How can I do that?

Réponses (1)

Paul
Paul le 24 Oct 2021
Modifié(e) : Paul le 24 Oct 2021
Preallocate an empty matrix with 231 columns and then use
doc vertcat
each time through the loop

Catégories

En savoir plus sur Creating and Concatenating 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!

Translated by