Reshape array 3 variables into 2?
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I have an array of A=1x100x50.
How can I reshape it in B=100x50?
I have tried with
B=reshape(A,[100, 50]);
But I get the error message
Error using reshape To RESHAPE the number of elements must not change.
Thanks in advance for your reply.
0 个评论
采纳的回答
Andrei Bobrov
2018-1-30
编辑:Andrei Bobrov
2018-1-30
B = squeeze(A)
or
B = permute(A,[2,3,1]);
or
B = reshape(A,size(A,2),[]);
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!