Invalid value for OPTIONS parameter PopInitRange: must be an array of finite doubles with two rows.

1 次查看(过去 30 天)
Getting this error Invalid value for OPTIONS parameter PopInitRange: must be an array of finite doubles with two rows. New in Matlab and don't know much about ga tool
% Fitness Function
function [y, z] = myFitness(x)
L = 610; % Length
P = 0.00000785; % Density
y = L * P * x(1) * x(2);
z = 1/(1+y);
end
and constrainst code
Constrainst Function
function[c,c_eq] = myConstrainsts(x)
W = 4500; %Design Load
L = 610; %Length
E = 2.1e05;
c = [(1.5 * W * L)/(x(1) * x(2)^2); ((0.375 * W * L^3)/(E * x(1) * x(2)^3))];
c_eq = [];
end

回答(1 个)

Alan Weiss
Alan Weiss 2019-4-12
Are you performing a multiobjective optimization? If not, then your fitness function should return a scalar, not two outputs. If so, then you should call gamultiobj, not ga.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by