Statistics Toolbox | ![]() ![]() |
Syntax
Description
returns the maximum with m = nanmax(a)
NaN
s treated as missing. For vectors, nanmax(a)
is the largest non-NaN
element in a
. For matrices, nanmax(A)
is a row vector containing the maximum non-NaN
element from each column.
also returns the indices of the maximum values in vector [m,ndx]
= nanmax(a)
ndx
.
m = nanmax(a,b)
returns the larger of a
or b
, which must match in size.
Example
m = magic(3);
m([1 6 8]) = [NaN NaN NaN]
m =
NaN 1 6
3 5 NaN
4 NaN 2
[nmax,maxidx] = nanmax(m)
nmax =
4 5 6
maxidx =
3 2 1
See Also
nanmin
, nanmean
, nanmedian
, nanstd
, nansum
![]() | mvtrnd | nanmean | ![]() |