Skip to Main Content Skip to Search
Product Documentation

max - Largest element in array of fi objects

Syntax

max(a)
max(a,b)
[y,v] = max(a)
[y,v] = max(a,[],dim)

Description

max(a,b) returns an array the same size as a and b with the largest elements taken from a or b. Either one can be a scalar.

[y,v] = max(a) returns the indices of the maximum values in vector v. If the values along the first nonsingleton dimension contain more than one maximal element, the index of the first one is returned.

[y,v] = max(a,[],dim) operates along the dimension dim.

When complex, the magnitude max(abs(a)) is used, and the angle angle(a) is ignored. NaNs are ignored when computing the maximum.

See Also

mean | median | min | sort

  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS