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

5 Ansichten (letzte 30 Tage)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- am 29 Okt. 2020
Beantwortet: Rik am 29 Okt. 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

Antworten (1)

Rik
Rik am 29 Okt. 2020
Loop over the rows, use isnan and use find with the 'last' switch.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by