Advertisement
Gigli-0neiric

Mole - false

Jan 31st, 2016
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.96 KB | None | 0 0
  1. function Mole(x_o, y_o, z_o)
  2.  
  3. clc; format compact; syms x y real
  4. if nargin == 0
  5.     x_o = 1;
  6.     y_o = 1;
  7.     z_o = .4;
  8. end
  9. function Mole(x_o, y_o, z_o)
  10.  
  11. clc; format compact; syms x y real
  12. if nargin == 0
  13.     x_o = 1;
  14.     y_o = 0;
  15.     z_o = 0.5;
  16. end
  17. f = exp(-(y-x.^2).^2); domain = [-5 5];
  18. g = matlabFunction(f);
  19. % Schnitt yz-ebene
  20. subplot(2,2,1)
  21. ezplot( subs(f,x,x_o));title('Schnitt der yz-Achse');
  22.  
  23. % Schnitt xz-Ebene
  24. subplot(2,2,2)
  25. ezplot( subs(f,y,y_o) );title('Schnitt der xz-Achse');
  26.  
  27. % Isohypse zum Niveau z0
  28. subplot(2,2,3)
  29. ezplot(f==z_o, domain )
  30.  
  31. subplot(2,2,4)
  32. ezsurf(f, domain);
  33. hold on; axis equal;
  34. % Schnitt in yz Ebene
  35. yz = ezplot3(@(y) x_o, @(y) y, @(y) g(y,x_o), domain); set(yz, 'color', 'blue')
  36. % Schnitt in xz Ebene
  37. xz = ezplot3(@(x) x, @(x) y_o, @(x) g(y_o,x), domain); set(xz, 'color', 'red')
  38. % Isohypse zum Niveau z_o in in xy Ebene projeziert
  39. iso = ezplot( f ==z_o , domain); set(iso, 'color', 'green')
  40. hold off;
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement