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
Nouhayla EL GHANI 2015년 9월 4일
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