フィルターのクリア

I am trying my hands on examples on genetic algorithms in MATHWORK CENTRAL. I would like someone to explain to me what the empty matix means .I saw it was defined for for equality contraints. But why are there four

1 回表示 (過去 30 日間)
function [c, ceq] = simple_constraint(x)
c = [1.5 + x(1)*x(2) + x(1) - x(2);...
-x(1)*x(2) + 10];
ceq = []; by
ObjectiveFunction = @simple_fitness;
nvars = 2; % Number of variables
LB = [0 0]; % Lower bound
UB = [1 13]; % Upper bound
ConstraintFunction = @simple_constraint;
rng(1,'twister') % for reproducibility
[x,fval] = ga(ObjectiveFunction,nvars,...
[],[],[],[],LB,UB,ConstraintFunction)

採用された回答

Walter Roberson
Walter Roberson 2018 年 6 月 28 日
[x,fval] = ga(ObjectiveFunction,nvars,...
[],[],[],[],LB,UB,ConstraintFunction)
can be rewritten as
A = []; b = [];
Aeq = []; beq = [];
[x,fval] = ga(ObjectiveFunction, nvars, ...
A, b, Aeq, beq, LB, UB, ConstraintFunction)
That is, there are no linear inequality constraints (A and b) and no linear equality constraints (Aeq and beq)

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by