MATLAB: How to create a loop for transpose row vector to column vector

time seriestranspose

Hi guys!
I have a data 4624X12 and i need transpose every line to columns, to getting a 55488X1 matrix.
I tried the following loop:
j=1; [row,col]=size(data); for i=1:row M(j)=data(i,:)'; j=j+1 end
This error appier in this situation: "??? In an assignment A(I) = B, the number of elements in B and I must be the same"
Tks every budy!

Best Answer

Your words "transpose every line to columns" hint that you wish the rows to remain contiguous within the single column. If so, do this:
M = data.';
M = M(:);