Converting a 4d vector to 2d vector
4 次查看(过去 30 天)
显示 更早的评论
Dear
I would like to convert the following 4d vector to a 2d vector.
input:
Y(:,:,1,1)=0
Y(:,:,2,1)=1
Expected output:
Y1(1,1)=1
Y1(1,2)=2
Thanks,
0 个评论
采纳的回答
Jos (10584)
2019-2-23
Y = randi(10,1,1,3,4)
Y2 = squeeze(Y) % remove singleton dimensions
help squeeze
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!