フィルターのクリア

I m using genetic algorithm toolbox/ code in Matlab. All i want is the result in particular range. ( not less than or greater than something)

1 回表示 (過去 30 日間)
harsh Brar
harsh Brar 2022 年 3 月 10 日
回答済み: Imran 2023 年 1 月 6 日
my objective function is this:=
function f = gaintobj(x)
f = 122.14-0.84.*x(1)-0.42.*x(2)+0.34.*x(3)-0.09.*x(4)+363.77.*x(5);
lower and upper bound are these:-
lb = [29 160 30 0 0.040];
ub = [50 180 60 20 0.069];
nvar = 5;
I want the value of f in the range of 40-80 only. I am an absolute beginner in MatLab. I am forever grateful to whoever solved the problem.

回答 (1 件)

Imran
Imran 2023 年 1 月 6 日
Hello Harsh,
I understand that you are using the 'Genetic Algorithm' toolbox and you want to have the output of your function in the range of 40-80 only.
You can use the 'ga' function to get the output in a specified range.
I hope this helps.

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by