Why can't I reshape my 4-D array?

Hello, I'm unable to reshape my 4-D array for some reason and cannot figure out why. The number of elements in the two arrays are equal. I would like to keep the first dimension (even though it only has one row because it's required for the brain imaging software I'm using). I've pasted my command and the error below.
Thanks in advance, -Erie
frtf_D_epoched = reshape(ctf_dD,1,40,800,75) Error using reshape To RESHAPE the number of elements must not change.
>> size(ctf_dD)
ans =
1 40 60000 1
>> 1*40*60000*1
ans =
2400000
>> 1*40*800*75
ans =
2400000

Answers (1)

You are probably using data with different number of elements
Try this
ctf_dD=rand(1,40,60000,1);
b=reshape(ctf_dD,1,40,800,75);

Categories

Find more on Vehicle Dynamics Blockset in Help Center and File Exchange

Asked:

on 4 Aug 2014

Answered:

on 4 Aug 2014

Community Treasure Hunt

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

Start Hunting!