Effacer les filtres
Effacer les filtres

Incorrect number or types of inputs and outputs for function 'isfinite'

38 vues (au cours des 30 derniers jours)
Weiying
Weiying le 7 Sep 2023
Commenté : Weiying le 7 Sep 2023
I want to solve this nonlinear system, but it always says in red: Incorrect number or types of inputs and outputs for function 'isfinite', and I'm a beginner I don't know how to fix it.
Could you please give me some advice? Thx.
x=fsolve('@system',[0 0])
Incorrect number or types of inputs or outputs for function 'isfinite'.

Error in fsolve (line 306)
if any(~isfinite(fuser))
function f=system(x)
f=[2*x(1)+x(2)+x(1)^3; x(1)+x(1)*x(2)+exp(x(1))];
end

Réponse acceptée

Florian Bidaud
Florian Bidaud le 7 Sep 2023
Modifié(e) : Florian Bidaud le 7 Sep 2023
You need to remove the quotes
x=fsolve(@system,[0 0])
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
x = 1×2
-0.3783 0.8108
function f=system(x)
f=[2*x(1)+x(2)+x(1)^3; x(1)+x(1)*x(2)+exp(x(1))];
end

Plus de réponses (0)

Catégories

En savoir plus sur Biotech and Pharmaceutical dans Help Center et File Exchange

Tags

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by