How to concatenate using for loop?

조회 수: 4 (최근 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