How to concatenate using for loop?

5 次查看(过去 30 天)
azarang asadi
azarang asadi 2021-10-24
编辑: Paul 2021-10-24
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?

回答(1 个)

Paul
Paul 2021-10-24
编辑:Paul 2021-10-24
Preallocate an empty matrix with 231 columns and then use
doc vertcat
each time through the loop

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by