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

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 4 Août 2014

0 votes

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);

Catégories

En savoir plus sur Vehicle Dynamics Blockset dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by