Unable to change InitialPopulationMatrix in GA problem options
1 次查看(过去 30 天)
显示 更早的评论
I have a problem called fopt; in fopt.options, fopt.options.InitialPopulationMatrix = [];
fopt.options.InitialPopulationMatrix = 'doubleVector'; and finally, fopt.options.PopulationSize = 340 and
fopt.nvars = 11. So, I have a script where I define a variable w of size 340x11 and then set:
fopt.options.InitialPopulationMatrix = w
Matlab replies with
Invalid value for OPTIONS parameter InitialPopulationMatrix: must be a two-dimensional matrix.
I've tried everything I can to find the proble, but to no avail. Even setting the line just before
fopt.options.InitialPopulationMatrix = w
to
size(w)
returns
ans =
340 11
and ismatrix(w) returns 1..... I've never had any issues setting this property before, so any help greatly appreciated.
2 个评论
Geoff Hayes
2019-2-1
Tom - how is w initialized? Could it be a cell array which would return the same above answers (for size and ismatrix)?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!