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
回答(1 个)
Azzi Abdelmalek
2014-8-4
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);
类别
在 帮助中心 和 File Exchange 中查找有关 Vehicle Dynamics Blockset 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!