customizing the index of reshape A 2X2 matrix

1 view (last 30 days)
So I have a 2x2 matrix
test=[1 2;16 9]
y=reshape(test,[],1)
which returns
1
16
2
9
I want it to reshape like this
1
2
16
9
Any suggestion would be highly appreciated.

Accepted Answer

madhan ravi
madhan ravi on 6 Sep 2020
Transpose Test before reshaping.
  2 Comments
ali akbar
ali akbar on 6 Sep 2020
Thank you madhan. I just realized how naive I was, I haven't thought about this simple thing beforehand.

Sign in to comment.

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!