Error in fsolve r2014b
显示 更早的评论
I try to use the fsolve command in a MATLAB code, and when i run it i get the following message:
Undefined function 'fsolve' for input arguments of type 'char'.
Error in Steam_func (line 39) res = fsolve('sft2_NC',x0)
I am using the MATLAB R2014b version on a MAC.
I have tried to run the code on another computer with R2013a installed, and here it works fine.
Do anyone know this problem?
回答(1 个)
Geoff Hayes
2014-11-27
Kasper - please verify that you have the Optimization Toolbox on this version of MATLAB by typing ver in the Command Window or which fsolve -all. The former will return your version of MATLAB and all installed toolboxes, while the latter will return the location of any functions that match fsolve.
If you do have access to this function, try changing the first input from a string to a function handle instead. So your code would become
fsolve(@sft2_NC,x0)
2 个评论
Kasper
2014-11-27
John D'Errico
2014-11-27
编辑:John D'Errico
2014-11-27
Indeed, you do not have that TB installed. Check your license online at TMW to see if you have bought that toolbox. If not, you either need to buy the optimization toolbox, or accept that you cannot use what you don't own. There are tools on the file exchange. Of course, sometimes you get what you pay for. And most of what you will find on the file exchange for this purpose are pretty simple Newton's method tools, many of which will require you to provide the gradient yourself.
类别
在 帮助中心 和 File Exchange 中查找有关 Platform and License 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!