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 个)

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 个评论

When i type ver i get:
MATLAB Version: 8.4.0.150421 (R2014b) MATLAB License Number: •••••• Operating System: Mac OS X Version: 10.10.1 Build: 14B25 Java Version: Java 1.7.0_55-b13 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode ---------------------------------------------------------------------------------------------------- MATLAB Version 8.4 (R2014b) MATLAB Coder Version 2.7 (R2014b) MATLAB Compiler Version 5.2 (R2014b) MATLAB Report Generator Version 4.0 (R2014b)
And which fsolve -all: 'fsolve' not found.
So it my look like i haven't the Optimization Toolbox installed?
John D'Errico
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 的更多信息

标签

提问:

2014-11-27

Community Treasure Hunt

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

Start Hunting!

Translated by