Skip to content

mustBeNonNan

miscellaneous · scripts/miscellaneous/mustBeNonNan.m

: mustBeNonNan (x)

Error unless no element of x is NaN (numeric, logical or char x; Inf passes; empty passes).

Intended as a validation function for inputParser and similar checks; it returns nothing and raises an error describing the offending elements when the check fails.