Find the minimum of “y=x*x” using genetic algorithm in Matlab [closed]
-
12-11-2019 - |
質問
Would somebody help me please in this question. I'm new in Matlab... And it's a bit hard for me to understand how to create and use genetic algorithm in Matlab. If anybody could help to write some very simple code for searching minimum/maximum of specified function. I read that the gatool should be used for that... but I can't understand the examples of Matlab help network. I'm doing the next steps:
In text editor I'm typing the next:
function y= parabola(x) y=x*x; end
Then I'm launching the
GATOOL
and specifying this function like@parabola
- Setting the number of variables (equals 2)
Initial range = [-10;10]
.The other parameters are set as Default
When I press
Start
Button I see a result:Error in fitnessfcn: Input argument "x" is undefined.
正しい解決策はありません
所属していません StackOverflow