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?
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!