Reshape 1xn vector with matlab

前端 未结 2 1617
没有蜡笔的小新
没有蜡笔的小新 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:55

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

    B = reshape(A,5,11)';
    

提交回复
热议问题