matlab - Reshape column vector -
hello i'm working matlab , have "z" column vector has dimension of (9680 x 1). want reshape in order have array "z" of dimension (44 x 220). i'm doing following:
z=reshape(z,44,220);
i tried:
z=reshape(z,[44,220]);
but output not right (at least first row). can see comparing output matrix initial vector.
i need 220 first positions of column vector length of first row of matrix, next 220 positions of vector second row of matrix , on till obtaining 44 rows.
what doing wrong? help.
matlab stores matrix values in column major format (this important during reshape). since want row major, need do
z = reshape(z, [220 44]).';
i.e. transpose afterwards.
Comments
Post a Comment