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개)

카테고리

도움말 센터File Exchange에서 NaNs에 대해 자세히 알아보기

질문:

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