Reshape multidimensional arrays - interpretation

1 view (last 30 days)
Hi,
I have a 5D array (X) with the following variables: A, B, C, D and E each having lengths 10, 4, 2, 1000 and 20.
I have reshaped X as following: X2 = reshape(X,[],1000,20). When I run size(X2), I get 80 1000 20, which I understand. However, when I plot X2(1,:,1) how should the plot be interpret? Is X2(1,:,1) equal to (A1,B1,C1) and X2(2,:,1) equal to (A2,B1,C1) or am I wrong?
Thanks!

Accepted Answer

Walter Roberson
Walter Roberson on 11 Nov 2019
First column of first plane
A1B1C1D1E1
A2B1C1D1E1
A3B1C1D1E1
A4B1C1D1E1
...
A10B1C1D1E1
A1B2C1D1E1
A2B2C1D1E1
A3B2C1D1E1
A4B2C1D1E1
...
A10B2C1D1E1
A1B3C1D1E1
A2B3C1D1E1
A3B3C1D1E1
A4B3C1D1E1
...
A10B3C1D1E1
A1B4C1D1E1
A2B4C1D1E1
A3B4C1D1E1
A4B4C1D1E1
...
A10B4C1D1E1
A1B1C2D1E1
A2B1C2D1E1
A3B1C2D1E1
A4B1C2D1E1
...
A10B1C2D1E1
A1B2C2D1E1
A2B2C2D1E1
A3B2C2D1E1
A4B2C2D1E1
...
A10B2C2D1E1
A1B3C2D1E1
A2B3C2D1E1
A3B3C2D1E1
A4B3C2D1E1
...
A10B3C2D1E1
A1B4C2D1E1
A2B4C2D1E1
A3B4C2D1E1
A4B4C2D1E1
...
A10B4C2D1E1
Second column of first plane: same except with D2 instead of D1.
Third column of first plane: same except with D3 instead of D1
So the first row of the first plane has A1B1C1D1E1 A1B1C1D2E1 A1B1C1D3E1 ... A1B1C1D1000E1
Second row of the first plane has A2B1C1D1E1 A2B1C1D2E1 A2B1C1D3E1 ... A2B1C1D1000E1
which does not disagree with what you wrote.

More Answers (0)

Categories

Find more on Christmas / Winter in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!