Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- colormap('jet')
- f=@(x,y)x.*(e.^(-x.^2-y.^2));
- x=-2:0.2:2;
- y=-2:0.2:2;
- [x1,y1]=meshgrid(x,y);
- z=f(x1,y1);
- subplot(2,2,1);
- surf(x,y,z);
- title('graph1');
- %b
- f=@(x,y)3.*sin(x).*cos(y);
- x=-5:81;
- y=0:81;
- [x1,y1]=meshgrid(x,y);
- z=f(x1,y1);
- subplot(2,2,2);
- surf(x,y,z);
- title('graph2');
- %c
- f=@(x,y)(sin(sqrt(x.^2+y.^2)))/(sqrt(x.^2+y.^2)+0.1);
- x=-8:0.2:8;
- y=-8:0.2:8;
- [x1,y1]=meshgrid(x,y);
- z=f(x1,y1);
- subplot(2,2,[3 4]);
- surf(x,y,z);
- title('graph3');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement