f(x)=(a+2b+3c+4d)-30. Write down the genetic algorithm for minimizing of f(x)?

18 ビュー (過去 30 日間)
Kunal  Kabi
Kunal Kabi 2017 年 3 月 23 日
コメント済み: Kunal Kabi 2017 年 4 月 2 日
How to execute it properly. I have done this far.
clc; clear all; close all; Fcneq=@myequa; nvars=4; [z,val]=ga(Fcneq,nvars);
function y=myequa(x) a=x(1); b=x(2); c=x(3); d=x(4); y=(a+(2*b)+(3*c)+(4*d))-30; end

回答 (1 件)

Santhana Raj
Santhana Raj 2017 年 3 月 23 日
Hi,
What problem you are facing with this code? If you dont want to use genetic algorithm for this, you can try patternsearch or particleswarm.
But I believe your problem is to define the limits and constraints of the input x and the output. If you, you then have to explain them more clearly.
Hope it helps.
Raj
  1 件のコメント
Kunal  Kabi
Kunal Kabi 2017 年 4 月 2 日
Sir i am asking is this code i have written is right or wrong ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by