Columns with at least one zero element
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (2)
Jos (10584)
il 16 Giu 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
il 16 Giu 2014
idx=~all(M);
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!