Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. %Exercitiul 2
  2.  
  3. %a
  4. f=@(x)(x.^2)-12.*x+11
  5. fzero(f,[-2 6])
  6.  
  7. %b
  8. f=@(x)3.*x+sin(x)-exp(x)
  9. fzero(f,0)
  10.  
  11.  
  12.  
  13. % Exercitiul 1
  14. k=16
  15. xlim([-8 8])
  16. ylim([-8 8])
  17. [x1,y1]=meshgrid(x,y);
  18. f=@(x,y)(sin(sqrt(k.*x.*x+k.*y.*y)./(sqrt(k.*x.*x+k.*y.*y)+10)))
  19. z=f(x1,y1)
  20. surf(x,y,z,'XDataSource','x','YDataSource','y','ZDataSource','z')
  21. for k=16:-0.2:0
  22. f=@(x,y)(sin(sqrt(k.*x.*x+k.*y.*y)./(sqrt(k.*x.*x+k.*y.*y)+10)))
  23. z=f(x1,y1);
  24. refreshdata()
  25. pause(0.1)
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement