Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [x,y]=meshgrid(-2.5:.01:2.5,-2.5:.01:2.5);
- k=2.*x.^2-1.05.*x.^4+(x.^6)./6+x.*y+y.^2;
- f=@(x) 2.*x(1).^2-1.05.*x(1).^4+(x(1).^6)./6+x(1).*x(2)+x(2).^2;
- figure(1)
- contourf(x,y,k,80)
- options = gaoptimset('PlotFcn',{@gaplotbestindiv,@gaplotbestf,@gaplotexpectation,@gaplotstopping},'TolFun',1e-4);
- [x,fval,exitflag,output] = ga(f,2,options)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement