Info
この質問は閉じられています。 編集または回答するには再度開いてください。
why is my code wrong ?
1 回表示 (過去 30 日間)
古いコメントを表示
Please see the files attached and let me know what is wrong with this
l_dp =
0.7101 0 0 0.0447 0.7701 0 0.0379 0.8407
0 0 0 1.5729 0.0635 0 0 0.5264
1.1636 0.4907 0 0 0.2497 0 1.0603 0
0 0 1.1273 0 0.1478 0 0 1.4100
and this not right since demand on a path should total to one ie the sum of each row should be 1
whats wrong with my code is it ub limit or what ?
Please do help
2 件のコメント
Geoff Hayes
2014 年 10 月 19 日
Bhavz - where in your code do you force that condition (that each row should sum to one) to be true? Or where do you expect that to be enforced (and why)?
回答 (1 件)
Matt J
2014 年 10 月 19 日
編集済み: Matt J
2014 年 10 月 19 日
ie the sum of each row should be 1
If the unknown vector x is supposed to satisfy this, then presumably you need to have linear equality constraints,
Aeq=kron(ones(1,8),eye(4));
beq=[1;1;1;1]
[x,fval,exitflag] = ga(@objectiveFun,...
32,[],[],Aeq,beq,lb,[],nonlcon,options);
6 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!