This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

dsp.Minimum

Find minimum values of input or sequence of inputs

Description

The dsp.Minimum object finds the minimum value of an input or sequence of inputs.

Note

The Running mode in the dsp.Minimum System object™ will be removed in a future release. To compute the running minimum in MATLAB®, use the dsp.MovingMinimum System object instead.

To compute the minimum value of an input or sequence of inputs:

  1. Create the dsp.Minimum object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects? (MATLAB).

Creation

Syntax

min = dsp.Minimum
min = dsp.Minimum(Name,Value)

Description

example

min = dsp.Minimum returns an object, min, that computes the value and/or index of the minimum elements in an input or a sequence of inputs over the specified Dimension.

min = dsp.Minimum(Name,Value) returns a minimum-finding object, min, with each specified property set to the specified value.

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects (MATLAB).

Set this property to true in order to output the minimum value of the input. Set this property to false in order to output the index of the minimum value of the input.

Dependencies

This property applies only when you set the RunningMinimum property to false.

When you set this property to true, the object computes the minimum value over successive calls to the object algorithm. When you set this property to false, the object computes the minimum value over the current input.

Set this property to true to output the index of the minimum value of the input.

Dependencies

This property applies only when you set the RunningMinimum property to false.

Set this property to true to enable resetting of the running minimum. When you set this property to true, you must specify a reset input to the step method to reset the running minimum. This property applies only when you set the RunningMinimum property to true.

Specify the event that resets the running minimum. This property applies only when you set the ResetInputPort property to true.

Specify the numbering used when computing the index of the minimum value as starting from either One or Zero.

Dependencies

This property applies only when you set the IndexOutputPort property to true.

Specify how the minimum calculation is performed over the data.

Dependencies

This property applies when you set the RunningMinimum property to false.

Specify the integer dimension of the input signal over which the object finds the minimum. The cannot exceed the number of dimensions in the input signal.

Dependencies

This property only applies when you set the Dimension property to Custom.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Fixed-Point Properties

Specify the rounding method.

Specify the overflow action.

Specify the product fixed-point data type.

Specify the product fixed-point type as a scaled numerictype object with a Signedness of Auto.

Dependencies

This property applies only when you set the AccumulatorDataType property to Custom.

Specify the accumulator fixed-point data type as one of | Same as product | Same as input | Custom |.

Specify the accumulator fixed-point type as a scaled numerictype object with a Signedness of Auto.

Dependencies

This property applies only when you set the AccumulatorDataType property to Custom.

Usage

For versions earlier than R2016b, use the step function to run the System object algorithm. The arguments to step are the object you created, followed by the arguments shown in this section.

For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Syntax

[val,ind] = min(x)
val = min(x)
ind = min(x)
val = min(x,r)

Description

example

[val,ind] = min(x) returns the minimum value, val, and the index or position of the minimum value, ind, along the specified Dimension of x.

val = min(x) returns the minimum value, val, of the input x. When the RunningMinimum property is true, val corresponds to the minimum value over successive calls to the algorithm.

ind = min(x) returns the zero- or one-based index ind of the minimum value when the IndexOutputPort property is true and the ValueOutputPort property is false. You must set the RunningMinimum property to false to use this syntax.

val = min(x,r) resets the state of min based on the value of reset signal, r, and the ResetCondition property. To enable this type of processing, set the RunningMinimum property to true and the ResetInputPort property to true.

Input Arguments

expand all

Data input, specified as a vector or a matrix. If x is a matrix, each column is treated as an independent channel. The minimum is determined along each channel. The object also accepts variable-size inputs. Once the object is locked, you can change the size of each input channel.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Reset signal used to reset the running minimum, specified as a scalar value. The object resets the running minimum if the reset signal satisfies the ResetCondition.

Dependencies

To enable this signal, set the RunningMinimum property to true and the ResetInputPort property to true.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical

Output Arguments

expand all

Minimum value of the input, returned as a scalar or a vector. The object determines the minimum value of the input along each channel. If the input is a column vector, the output is a scalar. If the input is a multichannel signal, the output signal is a 1-by-N vector, where N is the number of input channels.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi
Complex Number Support: Yes

Indices of the minimum values of the input, returned as a scalar or a vector. The object determines the indices of the minimum values of the input along each channel. If the input is a column vector, the output is a scalar. If the input is a multichannel signal, the output signal is a 1-by-N vector, where N is the number of input channels.

Data Types: double | uint32

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Find a minimum value and its index.

 min1 = dsp.Minimum;
 x = randn(100,1);
 [y, I] = min1(x) %#ok
y = -2.9443
I = 35

Compute a running minimum.

 min2 = dsp.Minimum;
 min2.RunningMinimum = true;
 x = randn(100,1);
 y = min2(x); 
 plot(y);

y(i) is the minimum of all values in the vector x(1:i).

Algorithms

This object implements the algorithm, inputs, and outputs described on the Minimum block reference page. The object properties correspond to the block parameters.

Extended Capabilities

Introduced in R2012a