Challenge

Week 4.1 - Genetic Algorithm

clear all
close all
clc

% DEFINING OUT SEARCH SPACE

x=linspace(0,0.6,150);
y=linspace(0,0.6,150);

% CREATING A 2DIMENSIONAL MESH

[xx, yy]=meshgrid(x,y);

% EVALUATING THE STALAGMITE FUNCTION 

for i=1:length(xx)
    for j=1:length(yy)
input_vector(1)=xx(i,j);
input_vector(2)=yy(i,j);
f(i,j)= stalagmite(input_vector);
    end
end

surfc(xx,yy,f)
xlabel('x value')
ylabel('y value')
shading interp
[input,fval]=ga(@stalagmite,2);

outputs

input_vector =0.6000 0.6000

fval=0

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.