MATLAB: How to extract entries from a matrix and a vector into a new vector in a specific way

entries extractionmatrix manipulationvectors

Hello, I want to extract the entries of a matrix and a vector into a new vector, like this:
M =
0.6000 0.8000
-0.8000 0.6000
t =
0.4000
0.8000
into this vector: v =
0.6000
0.8000
-0.8000
0.6000
0.4000
0.8000
How can I do it? and I would like to know how to do it the other way, like this: if v is given and I want to construct M and t from that v.
Thank you for your help!!

Best Answer

To get the correct order:
>> [reshape(M.',[],1);t(:)]
ans =
0.60000
0.80000
-0.80000
0.60000
0.40000
0.80000