Columns with at least one zero element
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (2)
Jos (10584)
am 16 Jun. 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
am 16 Jun. 2014
idx=~all(M);
Kategorien
Mehr zu Linear Algebra finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!