nanmax
Maximum, ignoring NaN values.
📝Syntax
y = nanmax(X)
[y, idx] = nanmax(X)
y = nanmax(X, Y)
[y, idx] = nanmax(X, [], dim)
📄Description

nanmax returns the maximum after removing NaN values; a slice made only of NaN yields NaN.

nanmax(X, Y) returns the element-wise maximum of X and Y, ignoring NaN.

The optional second output idx holds the indices of the maxima. It is equivalent to max(X, ..., 'omitnan').

💡Examples
[y, idx] = nanmax([1 NaN 5 NaN 3])
🔗See Also
maxnanminnansum
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub