problem with optimset not being recognized, R2012a

5 ビュー (過去 30 日間)
Matthew
Matthew 2012 年 3 月 6 日
コメント済み: Andreas Sprenger 2013 年 11 月 15 日
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

採用された回答

Matthew
Matthew 2012 年 3 月 7 日
I did a complete download and reinstall. After the reinstall, I located optimset in the path Arthur suggested above, as opposed to the one I found earlier in \funfun. But still no optimset. When I started matlab in told me that my Toolbox Path Cache was out of date. I reapplied the setting under general, and it started working.
Thanks Arthur for the help.

その他の回答 (4 件)

Arthur Goldsipe
Arthur Goldsipe 2012 年 3 月 7 日
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
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.

サインインしてコメントする。


Matthew
Matthew 2012 年 3 月 6 日
I have not deleted R2011b. optimset is in matlab\funfun, but it is not in this folder in R2012a.
Should I reinstall?

Matthew
Matthew 2012 年 3 月 6 日
I have reinstalled, but the problem remians, no optimset.
I installed on my laptop. NO PROBLEM!
What is the deal?
Thanks to anyone that can help.

Lea
Lea 2013 年 2 月 28 日
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
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by