Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Exercitiul 2
- %a
- f=@(x)(x.^2)-12.*x+11
- fzero(f,[-2 6])
- %b
- f=@(x)3.*x+sin(x)-exp(x)
- fzero(f,0)
- % Exercitiul 1
- k=16
- xlim([-8 8])
- ylim([-8 8])
- [x1,y1]=meshgrid(x,y);
- f=@(x,y)(sin(sqrt(k.*x.*x+k.*y.*y)./(sqrt(k.*x.*x+k.*y.*y)+10)))
- z=f(x1,y1)
- surf(x,y,z,'XDataSource','x','YDataSource','y','ZDataSource','z')
- for k=16:-0.2:0
- f=@(x,y)(sin(sqrt(k.*x.*x+k.*y.*y)./(sqrt(k.*x.*x+k.*y.*y)+10)))
- z=f(x1,y1);
- refreshdata()
- pause(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement