How to eliminate rows with NaN elements?

5 visualizaciones (últimos 30 días)
Mr M.
Mr M. el 21 de Abr. de 2015
Respondida: James Tursa el 21 de Abr. de 2015
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

Más información sobre NaNs en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by