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 :)
0 个评论
采纳的回答
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.
0 个评论
更多回答(1 个)
Nouhayla EL GHANI
2015-9-4
1 个评论
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 Center 和 File 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!