How to create initial population of 100 random set of coefficient for design filter using genetic algorithm?

조회 수: 1 (최근 30일)
The vector contain a 51 coefficients ,and i want to random a vector 100 times (initialization in GA),what is the method ?does it is create a function give me every time a different vector, or random the same vector?

채택된 답변

Dimitris Kalogiros
Dimitris Kalogiros 2018년 8월 9일
Hi Johan
I suggest the following script:
% Generation of N sets of coefficients. Each set of contains M values
N=100; %number of sets
M=51; % number of coefficients inside each set
Range.low=-1; %upper limit of coeff's value
Range.up=1; %lower limit of coeff's value
taps=zeros(N,M);
for n=1:N
taps(n,1:M)=Range.low+(Range.up-Range.low)*rand(1,M); %generation of one set of taps
end
I generate sets of taps one at a time , cause you maybe want to add a correlation between sucessive sets.
Off course, all sets of coefficients can be created instantaneously:
taps=Range.low+(Range.up-Range.low)*rand(N,M);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by