problem with optimset not being recognized, R2012a
이전 댓글 표시
I just loaded R2012a this morning and my old m-files are broken. I am having trouble with optimset, and just decided to put optimset in the m-file, as the help says "optimset" alone should return the options. Instead I get this error:
Undefined function or variable 'optimset'
which optimset
yields:
'optimset' not found
even though which lsqcurvefit yields: C:\Program Files\MATLAB\R2012a\toolbox\shared\optimlib\lsqcurvefit.m
Here is my output from ver: MATLAB Version: 7.14.0.739 (R2012a) MATLAB License Number: ####### [SCd Censor] Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java Version: Java 1.6.0_17-b04 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode -------------------------------------------------------------------------------------------------------
MATLAB Version 7.14 (R2012a)
Simulink Version 7.9 (R2012a)
Bioinformatics Toolbox Version 4.1 (R2012a)
Control System Toolbox Version 9.3 (R2012a)
Curve Fitting Toolbox Version 3.2.1 (R2012a)
DSP System Toolbox Version 8.2 (R2012a)
Data Acquisition Toolbox Version 3.1 (R2012a)
Image Acquisition Toolbox Version 4.3 (R2012a)
Image Processing Toolbox Version 8.0 (R2012a)
Instrument Control Toolbox Version 3.1 (R2012a)
MATLAB Compiler Version 4.17 (R2012a)
MATLAB Report Generator Version 3.12 (R2012a)
Neural Network Toolbox Version 7.0.3 (R2012a)
Optimization Toolbox Version 6.2 (R2012a)
Parallel Computing Toolbox Version 6.0 (R2012a)
Partial Differential Equation Toolbox Version 1.0.20 (R2012a)
Signal Processing Toolbox Version 6.17 (R2012a)
SimBiology Version 4.1 (R2012a)
SimMechanics Version 4.0 (R2012a)
Simscape Version 3.7 (R2012a)
Spreadsheet Link EX Version 3.1.5 (R2012a)
Stateflow Version 7.9 (R2012a)
Statistics Toolbox Version 8.0 (R2012a)
Symbolic Math Toolbox Version 5.8 (R2012a)
Wavelet Toolbox Version 4.9
What happened to my install?
Thanks
채택된 답변
추가 답변 (4개)
Arthur Goldsipe
2012년 3월 7일
6 개 추천
I would first ensure that optimset.m got installed. Based on the location of your R2012a installation, look for the file at C:\Program Files\MATLAB\R2012a\toolbox\matlab\optimfun\optimset.m. If the file is not there, then the toolbox got installed incorrectly. If that's the case, I would contact technical support for further help.
If the file is there, it sounds like your MATLAB path got corrupted. From the MATLAB prompt, run the command restoredefaultpath and see if optimset is then available. If it is, you can save this restored path by running the command savepath. If you used to have some of your own directories added to the path, you will need to add them back and re-run savepath. You can also manage the path using a graphical tool, which you can open by running the pathtool command or by selecting File > Set Path from the Desktop menu.
댓글 수: 1
Marc Ramsey
2012년 5월 28일
Thank you for this answer. I had the same problem this morning when upgrading from r2010a to r2012a, and this fixed it.
Lea
2013년 2월 28일
0 개 추천
I have the same problem "undefined function optimset for char' but only when running it in a "parfor loop". If I run it just as a "for loop", it works fine. The problem only occured after installing r2012b. anyone that can help?
댓글 수: 1
Andreas Sprenger
2013년 11월 15일
Optimset meanwhile resides in a separate folder. Check whether
%matlabroot%\toolbox\matlab\optimfun
is in your standard path (using path or Set Path via File Open or Ribbon).
Adding this folder resolves the problem.
카테고리
도움말 센터 및 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!