Azzera filtri
Azzera filtri

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

38 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Florian Bidaud
Florian Bidaud il 7 Set 2023
Modificato: Florian Bidaud il 7 Set 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

Più risposte (0)

Categorie

Scopri di più su Biotech and Pharmaceutical in Help Center e File Exchange

Tag

Prodotti


Release

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by