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

4 ビュー (過去 30 日間)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- 2020 年 10 月 29 日
回答済み: Rik 2020 年 10 月 29 日
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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by