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

5 次查看(过去 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
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