How can I make this operation on two matrixes ?

1 view (last 30 days)
Hi every body
I have two matrixes as : M = [ 2, 8, 12 ] and K = [ 4 ,1 , 5 ].
So How can i get Z = [ 2, 4, 8, 1, 12, 5]. I mean the first value in the Z took from first value in M and the second value in Z from first value from K. And the third value in Z is the second in M and the fourth value in Z is the second value in K and so on, one by one.
Thank you

Accepted Answer

Walter Roberson
Walter Roberson on 21 Jul 2017
reshape([M;K], 1, [])

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!