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

4 次查看(过去 30 天)
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

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by