Advertisement
neron476

matlab_2

Mar 5th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. %t = linspace(0, 2*pi, 100000)
  2. %y = sin(sin(t));
  3. %subplot(1,2,1)
  4. %plot(y, 'r --')
  5. %subplot(1,2, 2)
  6. %plot(g, 'b')
  7. %title('MY WORLD')
  8. %grid on
  9. %legend('y', 'g')
  10. %comet(x,y)
  11. %x = linspace(-5, 5, 100);
  12. %y1= 0.1*exp(1+x);
  13. %y2 = 1./ (1 + 1./(1+x));
  14. %plot(x, y1, x, y2)
  15. %[xx,yy]= ginput(2)
  16. Ax = rand*20 - 10
  17. Ay = rand*20 - 10
  18. plot(Ax, Ay, '*')
  19. axis ([-10 10 -10 10])
  20. hold on
  21. x = rand(1,10)*20 - 10;
  22. y = rand(1, 10)*20 - 10;
  23. r = rand(1, 10)*20 - 10;
  24. t = linspace(0.2*pi, 100)
  25. for i = 1:10
  26. x = r(i).* sin(t) + x(i);
  27. y = r(i).* cos(t) + y(i);
  28. if(r(i) < ((Ax-x(i))^2+((Ay-y(i))^2)^(1/2)))
  29. plot(x,y, 'r')
  30. axis equal
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement