How to find last non-NaN element and replace it with NaN?

3 visualizaciones (últimos 30 días)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- el 29 de Oct. de 2020
Respondida: Rik el 29 de Oct. de 2020
How can I find for each row of the matrix in Matlab the index of the last non-NaN element and replace these values with NaN?
Thank you

Respuestas (1)

Rik
Rik el 29 de Oct. de 2020
Loop over the rows, use isnan and use find with the 'last' switch.

Categorías

Más información sobre Loops and Conditional Statements 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