Generic algorithm to calculate the global maxima of a stalagmite function
Objective: clearall closeall clc x=linspace(0,0.6,150); y-linspace(0,0.6,150); [xx,yy]=meshgrid(x,y) numcases=50; fori=1:length(xx) forj=1:length(yy) inputvector(1)=xx(i,j); inputvector(2)=yy(i,j); f(i,j)=stalagmite(inputvector); end end surf(xx,yy,-f) shadinginterp [inputs,fval]=ga(@stalagmite,2) xlabel(\'xvalue\') ylabel(\'yvalue\')…