www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/ComputeTheMedianExample.m

    %% Compute The Median
%%
% *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).

%%
% Compute the median value of the input column using the |dsp.Median|
% object.
 h = dsp.Median;
 x = [7 -9 0 -1 2 0 3 5 -9]';
 y = h(x)