function [SmoothRMS] = smooth(RMS,n) % smooths the RMS matrix by taking the mean of each point with the n data points % before and the n points after it (in time) to replace the point itself. SmoothRMS = RMS; L = length(RMS(:,1)); E = length(RMS(1,:)); for i = 1:E for j = (n+1):(L-n) SmoothRMS(j,i) = mean(RMS((j-n):(j+n),i)); end end end