MOTDSP566 DSP Blockset |
|
Search Help Desk |
MOTDSP566 Minimum | Contents See Also |
Purpose
Find the minimum value of one or two input vector(s).
Library
Motdsp566lib
Description
The MOTDSP566 Minimum block identifies the value and position of the smallest element in the input.
If the block has two input vectors, the block performs an element-by-element comparison of the input vectors. Each element of the block output vector is the result of the comparison of the elements of the input vectors.
If the block has only one input vector, the Mode parameter specifies the block's mode of operation and can be set to Value, Index, or Value and Index. These settings are described below.
Value
When Mode is set to Value, the block computes the minimum value of the input vector.
[y,i] = mot566_min(u(:)) % equivalent MATLAB code
The block output, y, is the minimum value of the input vector. For complex inputs
the block uses the magnitude of the input, abs(u(:))
, to identify the
minimum. The output is the corresponding complex value from the input.
Index
When Mode is set to Index, the block performs the
computation shown above, and outputs the index, i, corresponding to the position
of the minimum value in the input vector. The index is an integer in the range [1 length(u(:))]
.
If there are duplicates of the minimum value in the input, the index corresponds to the
first occurrence. For example, if the vector input is [.1 .2 .3 .2 .1]
,
the index of the minimum value is 1
, not 5
.
Value and Index
When Mode is set to Value and Index, the block outputs both the value, y, and the index, i.
In all three of the above modes, a matrix input, u
, is treated as a
vector, u(:)
.
Dialog Box
MOTDSP566 Maximum | Largest component |