Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.22 KB | None | 0 0
  1. function [y] = ackley( xx )
  2.     d = 2;
  3.     a = 20;
  4.     b = 0.2;
  5.     c = 2.*pi;
  6.     s1 = xx(:,1).^2 + xx(:,2).^2;
  7.     s2 = cos(c*xx(:,1)) + cos(c*xx(:,2));
  8.     y = -a.*exp(-b.*sqrt(1./d.*s1))-exp(1./d.*s2)+a+exp(1);
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement