patternsearch error: undefined function

3 views (last 30 days)
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 Comments
Paul Kolodziej
Paul Kolodziej on 10 Sep 2017
Edited: Walter Roberson on 10 Sep 2017
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
Walter Roberson on 10 Sep 2017
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.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 28 May 2017
You may have path problems.
Run these from your Command Window (or a script):
restoredefaultpath
rehash toolboxcache
If those don’t work, Contact Support (link). You may have to reinstall everything.
  2 Comments
Nathanael  Kazmierczak
Nathanael Kazmierczak on 28 May 2017
Thanks for the suggestion. I executed those commands, but am still having the same problem. I've contacted Technical Support.
Star Strider
Star Strider on 28 May 2017
My pleasure.
You have my sympathies.

Sign in to comment.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!