フィルターのクリア

Please help, indexing of ND-Dimensional matrices

1 回表示 (過去 30 日間)
Muniba Shah
Muniba Shah 2018 年 11 月 22 日
編集済み: Stephen23 2018 年 11 月 22 日
Hey,
I'm stuck on this stupid thing and i know is obvious.
I have a 3D matrix of A = rand(5,4,3) and i want to change their shape from 5 x 4 matrix to 10 x 2 matrix.
I have tried B = reshape(A,10,2) which does not work at all then I also tried B = reshape(A,[],2) which does the job but it merges the matrix.
But how do i make it work???
Thank you!

採用された回答

Stephen23
Stephen23 2018 年 11 月 22 日
編集済み: Stephen23 2018 年 11 月 22 日
reshape(A,10,2,3)
But it really depends on the order that you want B to have, which you did not tell us. You might need to use permute too.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by