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!