Form a large matrix from n numbers of small matrices

前端 未结 2 435
再見小時候
再見小時候 2021-01-28 18:04

I am a new to MATLAB. I have generated n smaller matrices of numbers, say 3 x 1 by using a FOR loop. All the matrices are having random v

2条回答
  •  天涯浪人
    2021-01-28 18:30

    Do your really need the individual variables? Probably such a solution is simpler, using only one mmatrix:

    M=zeros(40,40)
    for idx=1:size(M,1)
       M(idx,:)=your_code_here()
    end
    

    Whenever you would have used M1 before, now use M(1,:) to get the first row of M

提交回复
热议问题