% constant plot
t = linspace(0,2*pi) ;
x = 0.5*sin(t) ;
for i = 1:100
plot(t,x,'r') ; % plot constant sine function
hold on
% Generating a random varying second function
dx = 0.1*randn(size(t)) ;
x2 = x+dx ; % A varying function
plot(t,x2,'color',rand(1,3)) ; % plot second varying function
hold off
legend('sin function','varying function')
drawnow
end