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!