[x,y] =
max(___) finds the indices of the maximum values
and returns them in array y, using any of the input
arguments in the previous syntaxes. If the largest value occurs multiple
times, the index of the first occurrence is returned.

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.

abs(a)

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,y] = max(a)

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.

Dimension to operate along, specified as a positive integer
scalar. dim can also be a fi object.
If you do not specify a value, the default value is the first array
dimension whose size does not equal 1.

Indices of the maximum values in array x,
returned as a scalar, vector, matrix, or multidimensional array. If
the largest value occurs more than once, then y contains
the index to the first occurrence of the value. y is
always of data type double.

When a or b is complex,
the max function returns the elements with the
largest magnitude. If two magnitudes are equal, then max returns
the first value. This behavior differs from how the builtin max function resolves ties between complex
numbers.