Optimization with Genetic Algorithm – A MATLAB Tutorial for beginners

In this tutorial, I will show you how to optimize a single objective function using Genetic Algorithm. We use MATLAB and show the whole process in a very easy and understandable step-by-step process.

For a tutorial on Constrained Optimization with Genetic Algorithm see this video: https://www.youtube.com/watch?v=esGZtl3gIlY&feature=youtu.be


Bita Hallajian says:

I want to write a Genetic Algorithm in Matlab to find the maximum value of f(x)=15x-x^2 where parameter x varies between 0 and 15. and x takes only integer values. and besides, i want to find that x which f(x) has the maximum value.
set up problem variables are:
search space=2^4=16
initial population: N=6
number of generation=20
The number of generation is the termination criterion for GA.
I use one gene for crossover and mutation.
i wrote these lines now :
for i=1:6

I will be very grateful for your helpful suggestions and advice.

omnia soliman says:

Thank you very much

clash titan says:

i want to use genetic algorithm to do character recognition .can you tell me how to do that

Vignesh Srinivasan says:

hi sir I want to implement genetic algorithm for cloud resource optimization. Can you help me!
I want to optimize the CPU make span…

Satish Natarajan says:

Every time I run this code, I get different values of x(1) and x(2).

L L4st says:

Hi, is there any on swarm algorithm or is this the same? Ps, not very familiar with this but needed for assignment

Yeoh Shen Horng says:

hi, is there a way to put make sure all the components in independent variables vector are integer?

Amit Shiuly says:

Can I get optimised equations from several equations

alaoui nail says:

i want to code matlab for genetic algoritme for image denoising email alaouinail@gmail.com

Farzaneh Bagheri says:

Nice explanation, But the fval should be around 0.04 not 2.43. Do you know why?

Alvin Palanca says:

can this equation be optimized in Genetic algorithm in mathlab — 1.39-0.003056a-0.0064b+0.1061c

Sai Krishnakanth says:

does the same code works in 2011


Thank you for this effort. Simple and great.
If you don’t mind I need to ask you some questions, would you please send me your email.

David Alagoa says:

Hi I’m currently struggling with an optimization problem in matlab. I am trying to optimize photovoltaic parameters using genetic algorithms but I keep getting errors or crazy outputs. HELP!

Abdul Conteh says:

can you demonstrate example on thermal unit commitment

maha aliha says:

Dear ,
your video is informative thanks for us you are giving your precise time. i have a question could you guide me how to use GA code in matlab simulink PI based three phase VSI ?

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!