shewel function writing to find the global minimum with three variables
Show older comments
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)
Alan Stevens
on 7 Dec 2020
0 votes
- You probably want abs not mod.
- You don't define F1 or F2 anywhere within the function
- You have ouput not output in the last line.
1 Comment
Maimona Adam
on 7 Dec 2020
Categories
Find more on General Applications in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!