fsolve: Undefined function 'fsolve' for input arguments of type 'function_handle'.

14 次查看(过去 30 天)
Hello ,
I'am trying to solve non linear problem, with f solve but I get always the error:
Undefined function 'fsolve' for input arguments of type 'function_handle'.
The code is:
function F=CL_tau_HS(t,x,Ga,lamda,sigmma_e,nu,e,ea,tau_p,P,k)
F[(x(3)/Ga)*cosh(lamda*x(1))+x(2)/Ga-sigma_e
x(4)-(x(5)/Ga)*2*lamda*sinh(lamda*x(1))
2*x(5)-(x(3)/Ga)*4*(lamda^2)*cosh(lamda*x(1))
x(5)*(1-x(1))+x(4)-(P/(E*t*ea))*(1+3*k*(1-(nu^2))*(1+(ea/e)))
(x(3)/(2*lamda))*sinh(lamda*x(1))+0.5*x(2)*x(1)+0.5*tau_p*(1-x(1))-0.5*P];
I call it in the main function using:
x0=[10 1 1 1 1];
const=fsolve(@(t,x)CL_tau_HS(t,x,Ga,lamda,sigmma_e,nu,e,ea,tau_p,P,k),x0)
Thanks :)

采纳的回答

Star Strider
Star Strider 2015-9-3
The fsolve function is in the Optimization Toolbox. Be sure you have that toolbox.
Also, it wants functions that take one argument — the vector of variables you want it to solve for. Yours give it two to solve for, but I suspect that shouldn’t be throwing the error you see.

更多回答(1 个)

Nouhayla EL GHANI
I think you are right because I tried to solve another simple equation, and it didn't work. Can you tell me please how I can check if I do have that toolbox. If not, what can I do?
Thanks
  1 个评论
Star Strider
Star Strider 2015-9-4
The easiest way to see if you have it is to type ver in the Command Window. Your entire MATLAB installation information will be displayed in the result, so if you have the Optimization Toolbox, it will be listed.
If you don’t have it, and you have a university license, ask the person who controls that license. Otherwise, you will have to buy the toolbox. Contact MathWorks for that.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by