shewel function writing to find the global minimum with three variables

I am writting a Schewel function with three variables x1,x2 and x3 with x (-400,400), I am trying to find the global minimum of a schwefel function Can anybody tell me whats wrong with function code.
function output = objective_function(in)
x1 = in(1);
x2 = in(2);
x3 = in(3);
output=(-x1.*sin(sqrt(mod(x1)))+(-x2.*sin(sqrt(mod(x2)))+(-x3.*sin(sqrt(mod(x3)));
ouput=[F1 F2];
end

Answers (1)

  1. You probably want abs not mod.
  2. You don't define F1 or F2 anywhere within the function
  3. You have ouput not output in the last line.

1 Comment

Thank you very mcuh, F1 and F2 is the outcome that I want obtain from the optimazation if I am not wrong . does have to be defined ??

Sign in to comment.

Categories

Find more on General Applications in Help Center and File Exchange

Asked:

on 6 Dec 2020

Commented:

on 7 Dec 2020

Community Treasure Hunt

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

Start Hunting!