%% Matrix of Noisy Data
% Create a matrix whose rows represent three noisy signals.  Smooth the three signals using a moving average, and plot the smoothed data.

x = 1:100;
s1 = cos(2*pi*0.03*x+2*pi*rand) + 0.5*randn(1,100);
s2 = cos(2*pi*0.04*x+2*pi*rand) + 0.4*randn(1,100) + 5;
s3 = cos(2*pi*0.05*x+2*pi*rand) + 0.3*randn(1,100) - 5;
A = [s1; s2; s3];
B = smoothdata(A,2);
plot(x,B(1,:),x,B(2,:),x,B(3,:))

% Copyright 2012 The MathWorks, Inc.