How can I fix the "matrix dimensions must agree" errors in ga
1 回表示 (過去 30 日間)
古いコメントを表示
hi,
when I run the optimtool , I see the "matrix dimensions must agree" .
how can I fix it? I think I can't write the fitness funct. correctly.
my fitness funct;
I try to write sum((i,j),x(i,j)*a(i,j))
a=[1000000 1 1 0 1 0; 1 1000000 0 1 0 1;1 0 1000000 1 1 0; 0 1 1 1000000 0 1;1 0 1 0 1000000 1; 0 1 0 1 1 1000000 ] ;
y=(sum(sum(a.*x))) ;
is it true?
and linear eq like this;
T = ones(1,6);
Aeq = blkdiag(T,T,T,T,T,T)
beq = ones(6,1)
12 件のコメント
Geoff Hayes
2019 年 2 月 14 日
Baris - I'm not sure what GAMS is; and I don't know what you mean by the output is 6x6 matrix(for x).
回答 (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!