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

채택된 답변

madhan ravi
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 CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by