MATLAB Answers

0

error variable y in fitness function

Asked by titasari rahmawati on 16 May 2019
Latest activity Edited by Stephan
on 16 May 2019
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

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephan
on 16 May 2019
Edited by Stephan
on 16 May 2019

function y=fungsi3(x)
y=2+exp(-(x(1).^2+x(2).^2)).*(sin(4*x(1))+cos(8*x(2)));
end

  0 Comments

Sign in to comment.