How to eliminate rows with NaN elements?

If there is at least one NaN value in a row, I would like to delete that row from my matrix.

 採用された回答

James Tursa
James Tursa 2015 年 4 月 21 日

3 投票

rows = any(isnan(myMatrix),2);
myMatrix(rows,:) = [];

その他の回答 (0 件)

カテゴリ

質問済み:

2015 年 4 月 21 日

回答済み:

2015 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by