How to eliminate rows with NaN elements?

4 views (last 30 days)
If there is at least one NaN value in a row, I would like to delete that row from my matrix.

Accepted Answer

James Tursa
James Tursa on 21 Apr 2015
rows = any(isnan(myMatrix),2);
myMatrix(rows,:) = [];

More Answers (0)

Community Treasure Hunt

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

Start Hunting!