Concatenation

Home Forums Matlab Concatenation

This topic contains 2 replies, has 2 voices, and was last updated by  Sylver 8 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #609

    Aero123
    Participant

    Hello,

    There are 30 arrays and each array has the size of 2998272×1. i.e. (data1,…..,data30)

    I want to concatenate all these arrays to make a single matrix of size 2998272×30.

    How to do this in for loop method and vector method.

    Thanks

    #610

    Aero123
    Participant

    I know that for 2 or 3 matrices we can use the command cat command

    cat(dim,data1,data2,data3). I want to know how to concatenate when we have many arrays. Thanks

    #611

    Sylver
    Participant

    You can make a loop and use eval.

    mat = zeros(length(data1),numArrays);
    for i = 1:numArrays
       mat(:,i) = eval(['data', num2str(i)]);
    end
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.