?? mav.m
字號:
function [out]=mav(v,n,all,in)
%
% mav.m
%
% Moving average filter
%
% v = current variable
% n = number of steps to include
% all = 0 to filter entire data set
% in = input data
% out = processed data
%
[pD pL]=size(in);
out=in;
%
% Filter all the data
%
if all == 0
for i = 1 : pL
for j = n +1 : pD
out(j,i)=mean(in(j-n:j,i));
end
end
out(1:n,:)=in(1:n,:);
end
%
% Filter just the one column
%
if all == 1
for j = n+1 : pD
out(j,v)=mean(in(j-n:j,v));
end
end
%
% Plot the current variable
%
plot(out(:,v));
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -