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

62 次查看(过去 30 天)
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

采纳的回答

Florian Bidaud
Florian Bidaud 2023-9-7
编辑:Florian Bidaud 2023-9-7
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

标签

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by