filter data
y ( n ) = 1 4 x ( n ) + 1 4 x ( n − 1 ) + 1 4 x ( n − 2 ) + 1 4 x ( n − 3 ) load count.dat x = count(:,1); Create the filter coefficient vectors. a = 1; b = [1/4 1/4 1/4 1/4]; Compute the 4-hour moving average of the data, and plot both the original data and the filtered data. y = filter(b,a,x); t = 1:length(x); plot(t,x, '--' ,t,y, '-' ) legend( 'Original Data' , 'Filtered Data' )