Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Mole(x_o, y_o, z_o)
- clc; format compact; syms x y real
- if nargin == 0
- x_o = 1;
- y_o = 1;
- z_o = .4;
- end
- function Mole(x_o, y_o, z_o)
- clc; format compact; syms x y real
- if nargin == 0
- x_o = 1;
- y_o = 0;
- z_o = 0.5;
- end
- f = exp(-(y-x.^2).^2); domain = [-5 5];
- g = matlabFunction(f);
- % Schnitt yz-ebene
- subplot(2,2,1)
- ezplot( subs(f,x,x_o));title('Schnitt der yz-Achse');
- % Schnitt xz-Ebene
- subplot(2,2,2)
- ezplot( subs(f,y,y_o) );title('Schnitt der xz-Achse');
- % Isohypse zum Niveau z0
- subplot(2,2,3)
- ezplot(f==z_o, domain )
- subplot(2,2,4)
- ezsurf(f, domain);
- hold on; axis equal;
- % Schnitt in yz Ebene
- yz = ezplot3(@(y) x_o, @(y) y, @(y) g(y,x_o), domain); set(yz, 'color', 'blue')
- % Schnitt in xz Ebene
- xz = ezplot3(@(x) x, @(x) y_o, @(x) g(y_o,x), domain); set(xz, 'color', 'red')
- % Isohypse zum Niveau z_o in in xy Ebene projeziert
- iso = ezplot( f ==z_o , domain); set(iso, 'color', 'green')
- hold off;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement