Genetic algorithm objective function

3 次查看(过去 30 天)
I want to create an objective function that will be the sum of a series of 100 variables that will have a range of values between 0 and 1.
Instead writing down a sum like this:
x(1)+x(2)+ ... + x(100)
I want to find an automated way for this sum of x()s to be created.
  1 个评论
嘉琦 常
嘉琦 常 2022-4-19
function [lb,ub,dim,fobj] = Get_Functions_details(F)
switch F
case 'F1'
fobj = @F1;
lb=0;
ub=1;
dim=100;
end
end
function o = F1(x)
o=sum(x.^2);
end

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genetic Algorithm 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by