Advertisement
Gigli-0neiric

Untitled

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