NaN selective removal from a matrix
Mostrar comentarios más antiguos
I have a matrix like this: a=[NaN NaN NaN NaN;NaN NaN NaN NaN;2 3 NaN 4;9 4 NaN 4;3 9 NaN 3];
and i want to remove all the rows that contains only NaN's to: b=[2 3 NaN 4;9 4 NaN 4;3 9 NaN 3];
please help me,
Ziv.
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 9 de Jul. de 2014
b = a(any(a == a,2),:);
Categorías
Más información sobre Logical 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!