amarnathy
Newbie level 3
- Joined
- Nov 8, 2011
- Messages
- 3
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,283
- Activity points
- 1,297
i need matlab code for genetic algorithm for the design of fir and iir filtersi can help anything related to genetic algorithm. feel free to ask.
Mahmud
Even I came across that tool and its examples.But I need a MATLAB code for genetic algorithm so that I can modify as per my requirement for my project.Kindly help
Hello, everybody
I use ¨Practical Genetic Algorithms - Randy L. Haupt, Sue Ellen Haupt¨, includes Matlab codes, introduction to GA, PSO, Ant System and some others heuristic Methods, also u can search for THE PRACTICAL HANDBOOK OFl GENETIC ALGORITHMS APPLICATIONES, i can´t put the links because are copyrights problems with edaboard.com
please PM me if u need some help.
I make my Eng Thesis using Optimization Techniques.
PSO(Particle Swarm Optimization)
GA(Genetic Algoritms)
Ant Colony Optimization
And recently include the EDA (Estimation of Distribution Algorithms ), there are a free toolbox for Matlab from Spanish PhD MATEDA
Best Regards
i can help anything related to genetic algorithm. feel free to ask.
Mahmud
i can help anything related to genetic algorithm. feel free to ask.
Mahmud
i can help anything related to genetic algorithm. feel free to ask.
Mahmud
i can help anything related to genetic algorithm. feel free to ask.
Mahmud
i can help anything related to genetic algorithm. feel free to ask.
Mahmud
%program for Genetic algorithm to maximize the function f(x) =xsquare
clear all;
clc;
%x ranges from 0 to 31 2power5 = 32
%five bits are enough to represent x in binary representation
n=input(‘Enter no. of population in each iteration’);
nit=input(‘Enter no. of iterations’);
%Generate the initial population
[oldchrom]=initbp(n,5)
%The population in binary is converted to integer
FieldD=[5;0;31;0;0;1;1]
for i=1:nit
phen=bindecod(oldchrom,FieldD,3);% phen gives the integer value of the
binary population %obtain fitness value
sqx=phen. ∧2;
sumsqx=sum(sqx);
avsqx=sumsqx/n;
hsqx=max(sqx);
pselect=sqx./sumsqx;
sumpselect=sum(pselect);
avpselect=sumpselect/n;
hpselect=max(pselect);
%apply roulette wheel selection
FitnV=sqx;
Nsel=4;
newchrix=selrws(FitnV, Nsel);
newchrom=oldchrom(newchrix,:);
%Perform Crossover
crossoverrate=1;
newchromc=recsp(newchrom,crossoverrate);%new population after crossover
%Perform mutation
vlub=0:31;
mutationrate=0.001;
newchromm=mutrandbin(newchromc,vlub,mutationrate);%new population after
mutation disp(‘For iteration’);
i
disp(‘Population’);
oldchrom
disp(‘X’);
phen
disp(‘f(X)’);
sqx
oldchrom=newchromm;
end
Enter no. of population in each iteration4
Enter no. of iterations4
oldchrom =
1 0 0 1 0
0 1 0 1 0
0 0 1 1 0
1 1 1 1 0
FieldD =
5
0
31
0
0
1
1
For iteration
i =
1
Population
oldchrom =1 0 0 1 0
0 1 0 1 0
0 0 1 1 0
1 1 1 1 0
X
phen =
18
10
6
30
f(X)
sqx =
324
100
36
900
For iteration
i =
2
Population
oldchrom =
1 1 1 0 0
0 1 1 0 1
0 0 1 1 0
1 0 1 0 1
X
phen =
28
13
6
21
f(X)
sqx =
784
169
36
441
For iteration
i =
3
Population
oldchrom =
0 0 0 0 1
0 0 1 1 1
0 0 0 0 1
1 0 1 0 0X
phen =
1
7
1
20
f(X)
sqx =
1
49
1
400
For iteration
i =
4
Population
oldchrom =
1 0 0 0 0
1 1 0 1 1
1 0 0 1 1
0 1 1 1 1
X
phen =
16
27
19
15
f(X)
sqx =
256
729
361
225
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?