Random Noise visualization using Dancing circle in MATLAB

MATLAB Program:


%First code:

figure;
pause(2);
t=0:0.08:3*pi;
e=10*rand(1,length(t)).*cos(t);
f=10*rand(1,length(t)).*sin(t);
for i=1:length(e)
    x=e(i)+cos(t);
    y=f(i)+sin(t);
    plot(x,y,'linewidth',5);
    axis([-10 10 -10 10]);
    axis square;
    pause(0.1);
end

%Second code:

axis([-10 10 -10 10]);
fill([-10 -10 10 10],[-10 10 10 -10],'k');
hold on;
pause(0.1);
t=0:0.1:3*pi;
e=10*rand(1,length(t)).*cos(t);
f=10*rand(1,length(t)).*sin(t);
for i=1:length(e)
    x=e(i)+cos(t);
    y=f(i)+sin(t);
    plot(x,y);
    axis([-10 10 -10 10]);
    axis square;
    pause(0.1);
end




No comments