?? medianfilter.m
字號:
function y=medianfilter(x,n)
% The function MEDIANFILTER returns data smoothed by n-point median filter.
%
% Calling sequence-
% y=medianfilter(x,n)
%
% Input-
% x - column vector of input data x(n)
% n - number of smoothing points
% Output-
% y - column vector of filtered data y(n)
%
%----- Define the smoothing range indexes
lbound = floor(n/2);
rbound = n-lbound-1;
y=x;
%----- Run the filter
for i=lbound+1:length(x)-rbound-1
y(i)=median(x(i-lbound:i+rbound));
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -