patternsearch error: undefined function
3 次查看(过去 30 天)
显示 更早的评论
I am attempting to run a patternsearch optimization for the first time. When I run the default patternsearch example (using https://www.mathworks.com/help/gads/patternsearch.html), I get the following error:
>> UnconstrainedPatternSearchMinimizationExample
Undefined function 'patternsearch' for input arguments of type
'function_handle'.
Error in UnconstrainedPatternSearchMinimizationExample (line 17)
x = patternsearch(fun,x0)
It appears that I have the global optimization toolbox installed, and furthermore that patternsearch is recognized as a function just like any of the other optimizers:
>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.1.0.441655 (R2016b)
MATLAB License Number: STUDENT
Operating System: Mac OS X Version: 10.12.3 Build: 16D32
Java Version: Java 1.7.0_75-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.1 (R2016b)
Simulink Version 8.8 (R2016b)
Control System Toolbox Version 10.1 (R2016b)
Curve Fitting Toolbox Version 3.5.4 (R2016b)
DSP System Toolbox Version 9.3 (R2016b)
Database Toolbox Version 7.0 (R2016b)
Global Optimization Toolbox Version 3.4.1 (R2016b)
Image Processing Toolbox Version 9.5 (R2016b)
Instrument Control Toolbox Version 3.10 (R2016b)
Neural Network Toolbox Version 9.1 (R2016b)
Optimization Toolbox Version 7.5 (R2016b)
Parallel Computing Toolbox Version 6.9 (R2016b)
Signal Processing Toolbox Version 7.3 (R2016b)
Simulink Control Design Version 4.4 (R2016b)
Statistics and Machine Learning Toolbox Version 11.0 (R2016b)
Symbolic Math Toolbox Version 7.1 (R2016b)
K>>
K>> exist('lsqnonlin')
ans =
2
K>> exist('patternsearch')
ans =
2
Any ideas about what the problem here might be? I'm running R2016b on a Mac Air.
Thanks,
Nathanael Kazmierczak
2 个评论
Paul Kolodziej
2017-9-10
编辑:Walter Roberson
2017-9-10
Nathanael, did you ever resolve your issue? I'm having the same problem and I contacted technical support, but I was wondering if you could help me out.
Walter Roberson
2017-9-10
What shows up for
which -all patternsearch
?
The problems described by the original author would be consistent with having installed the Global Optimization Toolbox, but with there being no license found for it.
采纳的回答
Star Strider
2017-5-28
You may have path problems.
Run these from your Command Window (or a script):
restoredefaultpath
rehash toolboxcache
2 个评论
更多回答(0 个)
另请参阅
类别
在 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!