Can someone explain why I am getting the error "Not enough input arguments (line 2)"?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
function f = fun( x )
f = 4./x(1)+9./x(2)+(x(1)+x(2));
end
function [ c,cequ ] = mycon( x )
c=[-x(1);
-x(2);
x(1)+x(2)-4];
cequ=[];
end
function myfun
x0=[1;1];
[x,f]=fmincon(@fun,x0,[],[],[],[],[],[],@mycon)
z=peaks;
surf(z);
end
0 commentaires
Réponses (1)
Stephan
le 24 Jan 2021
x0=[1;1];
[x,f]=fmincon(@fun,x0,[],[],[],[],[],[],@mycon)
z=peaks;
surf(z);
function f = fun( x )
f = 4./x(1)+9./x(2)+(x(1)+x(2));
end
function [ c,cequ ] = mycon( x )
c=[-x(1);
-x(2);
x(1)+x(2)-4];
cequ=[];
end
0 commentaires
Voir également
Catégories
En savoir plus sur Software Development Tools dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!