Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.72 KB | None | 0 0
  1. range = linspace(0,2*pi,3000);
  2.  
  3. Rx = ones(6, 3000);
  4. Ry = ones(6, 3000);
  5.  
  6. for i = 1:6
  7.     for n = 1:3000
  8.     point = position(range(n));
  9.     Rx(i,n) = point(i,1)*cos(point(i,2));
  10.     Ry(i,n) = point(i,1)*sin(point(i,2));
  11.     end
  12. end
  13.  
  14. F(3000) = struct('cdata',[],'colormap',[]);
  15.  
  16. for i = 1:3000
  17.     plot(   [0 Ry(1,i)] , [0 Rx(1,i)], '-o', ...
  18.             [Ry(1,i) Ry(1,i)+Ry(4,i)], [Rx(1,i) Rx(1,i)+Rx(4,i)], '-o', ...
  19.             [0 Ry(2,i)], [0 Rx(2,i)], '-o', ...
  20.             [0 Ry(6,i)], [0 Rx(6,i)], '-o',...
  21.             [Ry(6,i) Ry(6,i)+Ry(5,i)], [Rx(6,i) Rx(6,i)+Rx(5,i)], '-o', 'LineWidth', 1)
  22.  
  23.     set(gca, 'XDir','reverse')    
  24.     ylim([-6 6]);
  25.     xlim([-6 6]);
  26.     grid
  27.     F(i) = getframe(gcf);
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement