Advertisement
Guest User

Untitled

a guest
Dec 1st, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.38 KB | None | 0 0
  1. Ogranicenja
  2.  
  3. function [c, ceq]=consti(x)
  4. c=[x(1).^2*x(2)-1;
  5.     x(1).^2-x(2)+2];
  6. ceq=[];
  7. end
  8.  
  9. Funkcija
  10.  
  11. function y = alki(x)
  12. n=2;
  13. y=0;
  14. for i=1:n
  15.     y=y+20+exp(1)-20*exp((-1/5)*sqrt((1/n)*x(i).^2))-exp((1/n)*cos(2*pi*x(i)));
  16. end
  17. end
  18.  
  19.  
  20. [x1 x2]=meshgrid(-20:0.1:20)
  21. y=x1^2 + x2^2 +///uglavnom pises funkciju
  22. mesh(x1,x2,y)
  23.  
  24. gatool
  25.  
  26. @imefunkcije
  27. n
  28.  
  29. ..
  30. 1e^-5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement