Engee documentation

MinMax

Search for the minimum or maximum value.

minmax

Description

The MinMax block outputs either the minimum or maximum element(s) of the input signals. Whether the block outputs minimum or maximum values is determined by the value of the Function parameter.

The MinMax block ignores any input value that is equal to NaN unless every input value is equal to NaN. When all input values are equal to NaN, the output is equal to NaN, either as a scalar or as the value of each element of the output vector.

Ports

Input

Port_1 - input signal
scalar | vector | matrix

Input signal from which the block outputs maximum or minimum values.

  • When the block has a single input port, the input must be a scalar or vector. The block outputs a scalar equal to the minimum or maximum element of the input vector.

  • When a block has multiple input ports, all non-scalar input parameters must have the same dimensionality. The block expands any scalar input parameters to have the same dimensions as the non-scalar input parameters. The block outputs a signal that has the same dimensions as the input. Each output element is equal to the minimum or maximum of the corresponding input elements.

Dependencies

To support matrix input, the Number of input ports parameter must be set to an integer greater than one. All non-scalar input parameters must have the same dimensions.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Port_N - Nth input signal
scalar | vector | matrix

Input signal from which the block outputs maximum or minimum values.

When a block has multiple input ports, all non-scalar input parameters must have the same dimensions. The block expands any scalar input parameters to have the same dimensions as the non-scalar input parameters. The block outputs a signal that has the same dimensions as the input. Each output element is equal to the minimum or maximum of the corresponding input elements.

Dependencies

To support matrix input, the Number of input ports parameter must be set to an integer greater than one.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Output

Port_1 - minimum or maximum values
scalar | vector | matrix

When a block has one input port, the output is a scalar equal to the minimum or maximum element of the input signals.

When the unit has multiple input ports, the output is a signal having the same dimensions as the input. Each output element is equal to the minimum or maximum of the corresponding input elements.

Data types: Float64.

Parameters

Function - mathematical function
min (by default) | max

Specifies which function (min or max) will be applied to the input.

Usage in program code

Block parameter

Function

Values

min | max

By default

min

Number of input ports - number of input signals
1 (By default) | positive integer

Specify the number of inputs.

Usage in program code

Block parameter

Inputs

Values

positive integer

By default

1

Additional options

C code generation: Yes