Columns with at least one zero element
이전 댓글 표시
Hi,
If I have a matrix with random dimension mxn , how can I detect a column which have at least one zero element?
Thank you
채택된 답변
추가 답변 (2개)
Jos (10584)
2014년 6월 16일
Let M be your mxm matrix:
tf = any(M==0,1) % true for columns with at least 1 zero
C = M(:,~tf) % columns with no zeros
dpb
2014년 6월 16일
idx=~all(M);
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!