How to eliminate rows with NaN elements?

If there is at least one NaN value in a row, I would like to delete that row from my matrix.

 Respuesta aceptada

James Tursa
James Tursa el 21 de Abr. de 2015
rows = any(isnan(myMatrix),2);
myMatrix(rows,:) = [];

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 21 de Abr. de 2015

Respondida:

el 21 de Abr. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by