Columns with at least one zero element
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (2)
Jos (10584)
el 16 de Jun. de 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
el 16 de Jun. de 2014
idx=~all(M);
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!