Reshape error when converting 2D to 3D data

2 views (last 30 days)
I want to convert 2D data to 3D.
Currently I use :
for ix=1:200:size(data1,1)
However it is very slow. I try the following code then:
permute(reshape(data1, 200, 8578, 200), [1 3 2]);
But, I get the following error:
Error using reshape
To RESHAPE the number of elements must not change.
Size of data1 is 1751600x200.
Thank you for help.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 16 Nov 2020
xxx78*2 is going to end in 56 not in 16. The size should be 8758 not 8578
  1 Comment
edward kabanyas
edward kabanyas on 16 Nov 2020
yes, you are correct, the size should be 8758 not 8578

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!