Is there a way to define the values for the nvars variables they are incremented in steps, instead of all intermediary values defined in the bounds for running genetic algorithm.
7 ビュー (過去 30 日間)
古いコメントを表示
Hello Matlab engineers,
I have 4 optimization variables for the GA : * fstopb: the stopband frequency : (0.75:0.01:0.95) * wtrans: width of the transition band :linspace(0.208,0.1250,10) * deltas: the stop band attenuation in db : linspace(20,220,20) * deltap: the pass band ripple in db : linspace(2,10,25) I want these 4 nvars to take on specifically the values returned by the arrays, instead of all the values in between the bounds...is there a way ??
0 件のコメント
採用された回答
Walter Roberson
2016 年 2 月 14 日
Use integer constraints between 1 and 25 (inclusive), and use that x to index the array that has linspace(2,10,25) stored in it in order to determine the value you want to compute with.
4 件のコメント
Walter Roberson
2019 年 3 月 29 日
For example,
v1 = 0.75:.01:0.95;
v2 = linspace(0.208, 0.1250,10);
fun = @(x) v1(x(1)).^2 - sqrt(v2(x(2))), 1:2, [], [], [], [], [1 1], [length(v1), length(v2)])
x(1) and x(2) are integer constrained, but you can use those integers to index into the value vectors.
その他の回答 (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!