How to remove column with 0 in matrix?
1 次查看(过去 30 天)
显示 更早的评论
I have a 0x100x150 double, but how do I get rid of the zero, so it becomes 100x150?
采纳的回答
rakshit gupta
2023-6-6
You can use the squeeze() function in MATLAB to remove dimensions with size 1 in a multidimensional array.
The following code will give you, which is a 100x150 array but with same data as A.
% assuming your 0x100x150 double is named A
B = squeeze(A); % remove dimensions with size 1
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!