質問

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:

  1. In text editor I'm typing the next:

    function y= parabola(x)
        y=x*x;
    end
    
  2. Then I'm launching the GATOOL and specifying this function like @parabola

  3. Setting the number of variables (equals 2)
  4. Initial range = [-10;10].
  5. The other parameters are set as Default

    When I press Start Button I see a result:

    Error in fitnessfcn: Input argument "x" is undefined.

正しい解決策はありません

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top