MATLAB: How do i turn an array into a column vector

arraycolumnMATLABvector

I can't work out how to change my array into a column vector. I thought it was just putting ' after it, but that's not working. If I had A=[1,2,3,4] how would I make that into a 4×1 column vector?

Best Answer

For any kind of array you get a single column vector by
A(:)
Or if you are sure that A is a row vector,
A.'
Caution: A' is the conjugate transpose and the plain transpose is A.'