DSP Blockset    
Median

Find the median value of an input.

Library

Statistics

Description

The Median block computes the median value of each column in an M-by-N input matrix.

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, y, is a sample-based 1-by-N vector containing the median value for each column in u.

When M is odd, the block sorts the column elements by value, and outputs the central row of the sorted matrix.

When M is even, the block sorts the column elements by value, and outputs the average of the two central rows in the sorted matrix.

Complex inputs are sorted by magnitude, and the real and imaginary components are averaged independently (for even M).

Dialog Box

Supported Data Types

To learn how to convert to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

Maximum
DSP Blockset
Mean
DSP Blockset
Minimum
DSP Blockset
Sort
DSP Blockset
Standard Deviation
DSP Blockset
Variance
DSP Blockset
median
MATLAB

Also see Statistics for a list of all the blocks in the Statistics library.


  Mean Minimum