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