Reshape 1xn vector with matlab

前端 未结 2 1611
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 05:13

Hii i have a vector with a dimension of 1x55 and i want to reshape row by row and get a 11x5 matrix. CAn anyone help me ?

Here´s an example:

A=[1,2,3         


        
相关标签:
2条回答
  • 2020-12-07 05:53

    Reshape and transpose:

    reshape(A, 5, 11)'
    
    0 讨论(0)
  • 2020-12-07 05:55

    To get the answer you want, you need to reshape to a 5x11 matrix and take the transpose:

    B = reshape(A,5,11)';
    
    0 讨论(0)
提交回复
热议问题