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? .

 Akzeptierte Antwort

Jan
Jan am 11 Mär. 2021

1 Stimme

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.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 11 Mär. 2021

Kommentiert:

am 11 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by