Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1.  
  2. colormap('jet')
  3. f=@(x,y)x.*(e.^(-x.^2-y.^2));
  4. x=-2:0.2:2;
  5. y=-2:0.2:2;
  6. [x1,y1]=meshgrid(x,y);
  7. z=f(x1,y1);
  8. subplot(2,2,1);
  9. surf(x,y,z);
  10. title('graph1');
  11. %b
  12.  
  13. f=@(x,y)3.*sin(x).*cos(y);
  14. x=-5:81;
  15. y=0:81;
  16. [x1,y1]=meshgrid(x,y);
  17. z=f(x1,y1);
  18. subplot(2,2,2);
  19. surf(x,y,z);
  20. title('graph2');
  21. %c
  22. f=@(x,y)(sin(sqrt(x.^2+y.^2)))/(sqrt(x.^2+y.^2)+0.1);
  23. x=-8:0.2:8;
  24. y=-8:0.2:8;
  25. [x1,y1]=meshgrid(x,y);
  26. z=f(x1,y1);
  27. subplot(2,2,[3 4]);
  28. surf(x,y,z);
  29. title('graph3');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement