Problem using RESHAPE function
显示 更早的评论
I have problem for reshape 1d matrix (C1d(340029,1)) to 3d matrix (D3d(?,215,395)), Thank you for any help.
>> Error using reshape
>> Product of known dimensions, 84925, not divisible into total number of elements, 340029.
M = 215,
L = 395,
M*L = 215*395 = 84925,
C1d(340029,1),
D3d=reshape(C1d,[],M,L);
1 个评论
Adam
2019-5-3
340029 is neither divisible by 215 or 395 so how are you expecting it to reshape to that size?
回答(2 个)
Jan
2019-5-3
1 个投票
This cannot work. There is no number, which satisfies 340029 = X * 215 * 395 , but reshape does not change the number of elements.
Farshid Daryabor
2019-5-4
0 个投票
1 个评论
Walter Roberson
2019-5-4
The only time that can work is if the number of items in iz is divisible by 84925, which you cannot guarantee unless you know more about the K matrix.
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!