How to read 2d data and create a 3D matrix?

1 回表示 (過去 30 日間)
Burak Varol
Burak Varol 2021 年 3 月 11 日
コメント済み: Burak Varol 2021 年 3 月 11 日
I have a data which goes like the following:
A(1,1,1).....................A(1000,1,1)
A(1,2,1)......................A(1000,2,1)
...
A(1,110,1).................A(1000,110,1)
A(1,1,2)......................A(1000,1,2)
....
....................................A(1000,110,110)
how can I rehape this data as A 3d matrix? .

採用された回答

Jan
Jan 2021 年 3 月 11 日
B = reshape(A.', 1000, 110, 100);
In general all such transformations can be done by:
B = reshape(permute(reshape(A, [x,y,z]), [a,b,c]), [d,e,f])
In this case the inner reshape can be omitted and the permutation is a transposition.
  1 件のコメント
Burak Varol
Burak Varol 2021 年 3 月 11 日
Thank you Jan!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by