functionvectorMax
Returns the largest element of a vector
Information
Syntax
(b, i) = vectorMax (A, first, last);
Description
b is the largest element of vector A between indices first and last.
i contains the index of b in vector A.
First and last are optional. If first is omitted, then first = 1. If last is omitted, then last equals the size of A.
Examples
(b, i) = vectorMax({1.3, 1.2, 7.4, 3.6, 20.9, 0, -6.7, -100, 5, 0.1});
returns
b = 20.9;
i = 5;
(b, i) = vectorMax({1.3, 1.2, 7.4, 3.6, 20.9, 0, -6.7, -100, 5, 0.1}, 6, 9);
returns
b = 5;
i = 9;Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:] | A | ||
| Integer | first | 1 | |
| Integer | last | size(A, 1) |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | b | ||
| Integer | i |