Reputation: 45
I have a 500x2 array with some data in Matlab
X1 X2
X3 X4
X5 X6
.....
I want to arrange it in an array with one column
X1
X2
X3
X4
..
Can someone give me some tips as to how it can be done?
Thanks!
Upvotes: 2
Views: 51
Reputation: 45752
Assuming your array is called X
:
Xt = X'; %'// Use X.' if you're dealing with complex numbers
Xcol = Xt(:)
Or else you could do
Xcol = reshape(X', [], 1)
Upvotes: 4