How do I check if any elements are not a number in a matrix.

157 views (last 30 days)
I want to check that the matrix I have contains any non numbers in it. I guess I would use the any() function? I just don't know what code to use.

Accepted Answer

Friedrich on 24 Mar 2014
I think you are looking for isfinite. (isNaN covers NaN values only but isfinte covers NaN as well as Inf).

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by