| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
y = nanmax(X)
Y = nanmax(X1,X2)
y = nanmax(X,[],dim)
[y,indices] = nanmax(...)
y = nanmax(X) is the maximum max of X, computed after removing NaN values.
For vectors x, nanmax(x) is the maximum of the remaining elements, once NaN values are removed. For matrices X, nanmax(X) is a row vector of column maxima, once NaN values are removed. For multidimensional arrays X, nanmax operates along the first nonsingleton dimension.
Y = nanmax(X1,X2) returns an array Y the same size as X1 and X2 with Y(i,j) = nanmax(X1(i,j),X2(i,j)). Scalar inputs are expanded to an array of the same size as the other input.
y = nanmax(X,[],dim) operates along the dimension dim of X.
[y,indices] = nanmax(...) also returns the row indices of the maximum values for each column in the vector indices.
Find column maxima and their indices for data with missing values:
X = magic(3);
X([1 6:9]) = repmat(NaN,1,5)
X =
NaN 1 NaN
3 5 NaN
4 NaN NaN
[y,indices] = nanmax(X)
y =
4 5 NaN
indices =
3 2 1![]() | nancov | nanmean | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |