MATLAB: Matrix formed by Vectors?Easy question.

matrix formed by vectors

I have a matrix size=10×10. And I want to obtain each column as a vector. Or vectors will create a matrix. How can I do that? Thanks in advance.

Best Answer

Yup, simple:
M =randn(10);
for i1 = 1:size(M;2)
V{i1} = M(:,i1);
end
Then you have your vectors in the cells of V.
The other direction:
M = [v1,v2,v3,....,vN];
There vN has to be column vectors.
HTH