image thumbnail
from Global maximum point for 3D surface using GA by Ali Talib Oudah
Finding the global maximum height for 3D multiple peak surface using genetic algorithm

off=cross(parent,croprop)% arithmatic crossover
function off=cross(parent,croprop)% arithmatic crossover
[pops,numvar]=size(parent);
a=[-0.25,1.25;-0.25,1.25];rng=(a(:,2)-a(:,1))';
for i=1:2:pops
    if croprop > rand
        r=zeros(2,2);r=rng.*rand(1,2)+a(:,1)';
        offs(i,:)=r.*parent(i,:)+(1-r).*parent(i+1,:);
        offs(i+1,:)=(1-r).*parent(i,:)+r.*parent(i+1,:);
    else
        offs(i,:)=parent(i,:);
        offs(i+1,:)=parent(i,:);
    end
end
off=offs;

Contact us at files@mathworks.com