Create a fixed-point vector, and return the maximum value
from the vector.

x =
9
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 11

Create a fixed-point matrix.

a =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 10

Find the largest element of each row by finding the maximum
values along the second dimension.

x =
16
11
12
15
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 10

The output vector, `x`

, is a column vector
that contains the largest element of each row.

Create a fixed-point matrix.

a =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 10

Find the largest element of each column.

x =
16 14 15 13
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 10

The output, `x`

, is a row vector that contains
the largest elements from each column of `a`

.

Find the index of each of the maximum elements.

x =
16 14 15 13
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 10
y =
1 4 4 1

Vector `y`

contains the indices to the minimum
elements in `x`

.

Create two fixed-point arrays of the same size.

Find the largest elements from `a`

or `b`

.

m =
9.7998 4.7002 6.0000
3.1416 7.0000 9.2300
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 11

`m`

contains the largest elements from each
pair of corresponding elements in `a`

and `b`

.

Create a complex fixed-point vector, `a`

.

a =
1.0000 + 2.0000i 3.0000 + 6.0000i 6.0000 + 3.0000i 2.0000 - 4.0000i
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 12

The function finds the largest element of a complex vector
by taking the element with the largest magnitude.

ans =
2.2361 6.7083 6.7083 4.4722
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 12

In vector `a`

, the largest elements,
at position `2`

and `3`

, have a
magnitude of `6.7083`

. The `max`

function
returns the largest element in output `x`

and the
index of that element in output `y`

.

x =
3.0000 + 6.0000i
DataTypeMode: Fixed-point: binary point scaling
Signedness: Signed
WordLength: 16
FractionLength: 12
y =
2

Although the elements at index 2 and 3 have the same magnitude,
the index of the first occurrence of that value is always returned.