Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

Search This Blog

MATLAB graphics on Rotating wheel (m-file)


Code:

fill([-1 -1 1 1],[-1 1 1 -1],'k');
hold on;
pause(7);
axis([-1 1 -1 1]);
t2=0:0.01:2*pi;
x4=cos(t2);
y4=sin(t2);
plot(x4,y4,'w','linewidth',5);
axis equal;
hold on;
t=0:pi/4:2*pi;
x=cos(t);
y=sin(t);
axis equal;
hold on;
for i=1:200
    clf
 fill([-1 -1 1 1],[-1 1 1 -1],'k');
 axis([-1 1 -1 1]);
 hold on;
 t2=0:0.01:2*pi;
x4=cos(t2);
y4=sin(t2);
plot(x4,y4,'w','linewidth',5);
hold on;
q=[x;y];
e=pi/10*i;
z=[cos(e) -sin(e);sin(e) cos(e)];
k=z*q;
r=k(1,:);
d=k(2,:);
for i=1:length(r)
plot([r(i) 0],[d(i) 0],'w','linewidth',5);
end
axis square;
pause(0.2);
end



No comments

Popular Posts