Reshape matrix whilst maintaining pairs ordering

5 ビュー (過去 30 日間)
BOB
BOB 2018 年 8 月 22 日
コメント済み: Star Strider 2018 年 8 月 22 日
Hi, I have a 2 x 120 matrix which I'm trying to reshape to a 120 x 2 matrix.
To do this I'm using the following code:
y = reshape(y2, 120, 2);
But the code seems to mess up the pairs i.e. the pairs in the original form (2 x 120) are not the same as in the reshaped form (120 x 2).
If anyone could help with how to keep the ordering whilst simply reshaping the matrix that would be great.
Thanks,
Chris

採用された回答

Star Strider
Star Strider 2018 年 8 月 22 日
It always helps to have an example of the matrix you are starting with, and your intended result.
Does the transpose, .' (link) function (or operation) do what you want?
  2 件のコメント
BOB
BOB 2018 年 8 月 22 日
Yeah it does, cheers.
Star Strider
Star Strider 2018 年 8 月 22 日
Cheers!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by