User`s guide
Maximum
5-298
5Maximum
Purpose Find the maximum values in an input or sequence of inputs.
Library Statistics
Description The Maximum block identifies the value and position of the largest element in
each column of the input, or tracks the maximum values in a sequence of inputs
over a period of time. The
Mode parameter specifies the block’s mode of
operation and can be set to
Value, Index, Value and Index, or Running.
Value Mode
When Mode is set to Value, the block computes the maximum value in each
column of the M-by-N input matrix
u independently at each sample time.
val = max(u) % Equivalent MATLAB code
For convenience, length-M 1-D vector inputs and sample-based length-M row
vector inputs are both treated as M-by-1 column vectors.
The output at each sample time,
val, is a 1-by-N vector containing the
maximum value of each column in
u. For complex inputs, the block selects the
value in each column that has the maximum magnitude,
max(abs(u)), as
shown below.
The frame status of the output is the same as that of the input.
Index Mode
When Mode is set to Index, the block computes the maximum value in each
column of the M-by-N input matrix
u,
[val,idx] = max(u) % Equivalent MATLAB code
abs(u)
Comp
l
ex
Output (val)
42i+
3– i–
44i+
14+– i
4– i–
4.47
3.16
5.66
4.12
4.12
44i+