MATLAB中输入参数的数目不足该如何解决。
Afficher commentaires plus anciens
function y = simple_fitness(x)
y = 100*(x(1)^2 - x(2))^2 + (1 - x(1))^2;
function [c,ceq] = simple_constraint(x)
c = [1.5 + x(1)*x(2) + x(1) - x(2);-x(1)*x(2) + 10];
ceq = [];
Objective Function = @simple_fitness;
nvars = 2;
LB = [0 0];
UB = [1 13];
ConstraintFunction = @simple_constraint;
[x,fval] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB,ConstraintFunction)
simple_fitness
输入参数的数目不足。
出错 simple_fitness (line 2)
y = 100*(x(1)^2 - x(2))^2 + (1 - x(1))^2;
我用的是MATLAB64位R2016a
我经常遇到输入参数数目不足的问题,有谁能告诉我这怎么解决?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Optimization Toolbox 快速入门 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!