Columns with at least one zero element
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (2)
Jos (10584)
le 16 Juin 2014
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
le 16 Juin 2014
idx=~all(M);
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!