Invalid value for OPTIONS parameter PopInitRange: must be an array of finite doubles with two rows.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (1)
Alan Weiss
le 12 Avr 2019
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
0 commentaires
Voir également
Catégories
En savoir plus sur Solver Outputs and Iterative Display dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!