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!