how to remove zero matrix(all elements are zeros) from 'distances which is 3d matrix'??
1 次查看(过去 30 天)
显示 更早的评论
distances = reshape(dist3,[100,250,484]);
in the above "distances" matrix there are 231 matrices in which all the elements are zeros. i want to delete all 231 matrices. so that size of dstances matrix should be 100*250*253
0 个评论
采纳的回答
madhan ravi
2019-8-28
编辑:madhan ravi
2019-8-28
distances(:,:,squeeze(~all(distances,[1,2])))=[]
% if you're using an older version then:
distances(:,:,squeeze(~all(all(distances,2),1)))=[]
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Detection 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!