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

8 vues (au cours des 30 derniers jours)
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 :)

Réponse acceptée

Star Strider
Star Strider le 3 Sep 2015
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.

Plus de réponses (1)

Nouhayla EL GHANI
Nouhayla EL GHANI le 4 Sep 2015
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 commentaire
Star Strider
Star Strider le 4 Sep 2015
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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by