error variable y in fitness function

1 回表示 (過去 30 日間)
titasari rahmawati
titasari rahmawati 2019 年 5 月 16 日
編集済み: Stephan 2019 年 5 月 16 日
how to write fitness function in matlab...
please help me.. because im write this is error:
function y=fungsi3(x)
y=2+exp(-(x(1)^2)+(y(1)^2)).*(sin(4*x(1))+cos(8*y(2)));
end

回答 (1 件)

Stephan
Stephan 2019 年 5 月 16 日
編集済み: Stephan 2019 年 5 月 16 日
function y=fungsi3(x)
y=2+exp(-(x(1).^2+x(2).^2)).*(sin(4*x(1))+cos(8*x(2)));
end

カテゴリ

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