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
| Argument | Type | Description | Unit |
|---|---|---|---|
x1 | scalar or vector | ... | ... |
x2 | scalar or vector | - | - |
... | ... | - | - |
Outputs / Return Value
y:yis the maximum element.id:idis the index of the maximum element found first.
Notes
- Row-wise operation
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
- Legacy parameter naming does not exactly match current engine metadata and should be reviewed manually.