max

Maximum element of an array if there is a single array argument; the maximum value from all values in the arguments

Syntax

[y, id] = max ( x1,x2,... )
[y, id] = x1.max ( x2,... )

Inputs

ArgumentTypeDescriptionUnit
x1scalar or vector......
x2scalar or vector--
......--

Outputs / Return Value

Notes

Examples

a=[8 2 4 6]; max(a) or a.max → 8
b=[3 9 -1]; max(a,b) or a.max(b) → 9
Multiple output [a,b]=(1:10:120).matrix(3).max() returns
a=
31
71
111

b=
4
4
4

See Also

Review Status