BrokkoliMan

oppgave381

Oct 23rd, 2020
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %a
  2. x = 0:pi/10:2*pi;
  3. y = x;
  4. [x,y] = meshgrid(x,y);
  5. u = cos(x);
  6. v = sin(x);
  7. quiver(x,y,u,v);
  8. %b
  9. x = -2:.5:2;
  10. y = x;
  11. [x,y] = meshgrid(x,y);
  12. v = -x./(x.^2+y.^2).^(3/2);
  13. u = -y./(x.^2+y.^2).^(3/2);
  14. quiver(x,y,u,v)
  15. %c
  16. x = -1:0;
  17. y = x;
  18. [x,y] = meshgrid(x,y);
  19. u = ((1-x)/((x-1).^2+y.^2))+ ((1+x)/((x+1).^2+y.^2))
  20. v = ((-y)/((x-1).^2+y.^2))+ ((y)/((x+1).^2+y.^2))
  21. quiver(x,y,u
RAW Paste Data