Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I write sum(j,x(i,j))=1 in GA ? - please answer please

1 回表示 (過去 30 日間)
Baris Karakum
Baris Karakum 2019 年 2 月 14 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
In my problem I have x(i,j)-(6*6) matrix and I want to solve the problem with global opt. tool.
then, I have a const like
sum(j,x(i,j)=1 , likely you know,but it's mean;
x(1,1)+x(2,1)+x(3,1)....+x(6,1)=1
x(1,2)+x(2,2)+x(3,2)....+x(6,2)=1
.
.
x(1,6)+x(2,6)+x(3,6)....+x(6,6)=1
how can I write this in ga ?
I can write sum(i,x(i,j)) by;
T = ones(1,6);
Aeq = blkdiag(T,T,T,T,T,T);
beq = ones(6,1);

回答 (3 件)

Baris Karakum
Baris Karakum 2019 年 2 月 15 日
Anybody here ?

Baris Karakum
Baris Karakum 2019 年 2 月 15 日
nobody really ?

Alan Weiss
Alan Weiss 2019 年 2 月 15 日
I am not sure that I understand what you are asking. You seem to know about Aeq and beq and their syntax. Is what you want a way to turn your x variable from a matrix to a vector? Basically, ga insists on each x variable being represented by a row vector. See Matrix Arguments, which discusses how linear constraint matrices view constraints.
In other words, I think that the answer to your question is to properly interpret your matrix of x(i,j) as a vector x(i) for a longer index i. But maybe I misunderstand.
Alan Weiss
MATLAB mathematical toolbox documentation

Community Treasure Hunt

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

Start Hunting!

Translated by