MATLAB Answers

Is there a (convenient) way to find out which Toolbox you need for code written by somebody else in the past?

9 views (last 30 days)
Joost Eijkenboom
Joost Eijkenboom on 3 Sep 2018
Edited: dpb on 3 Sep 2018
Hi! I am using code written by somebody else (to create a statistical shape model). I get an error in the "optimset" function, which could be related to a missing toolbox AFAIK. Is there a check I can let Matlab perform on my scripts, to see what toolboxes are required? That would be an awesome function.
Error message:
Error using optimset (line 219) Unrecognized parameter name 'LargeScale'. Please see the optimset reference page in the documentation for a list of acceptable option parameters. Link to reference page.
Could this be because I mis the optimization toolbox?
Thank you in advance!

  0 Comments

Sign in to comment.

Answers (3)

Image Analyst
Image Analyst on 3 Sep 2018
optimset() appears to be in base MATLAB, but there is an enhanced version in the Optimization toolbox because the help says "If you have an Optimization Toolbox™ license, you can also use optimset to create an expanded options structure containing additional options specifically designed for the functions provided in that toolbox."
I don't know how to determine in advance if your code uses the expanded options version or the base version. I don't think doing a dependency report would tell you that. If you want to do a dependency report that lists all functions used by your function you can click on the little down arrow on the title bar of the Current Folder window and do Reports/Dependency Report. It will tell you if the function is a toolbox function, but if you don't have that toolbox, it will just say "unknown" in a red box.

  0 Comments

Sign in to comment.


Andreas Goser
Andreas Goser on 3 Sep 2018
Not sure if the following counts as "convenient", but I would get a trial with many if not all products, run the code or execute a full workflow.
After that run
license('inuse')
That will return all products that have been used after start of MATLAB.

  0 Comments

Sign in to comment.


dpb
dpb on 3 Sep 2018
Edited: dpb on 3 Sep 2018
Unfortunately, "no, not really". One of the real problems in MATLAB design is namespace pollution and with the tremendous proliferation of functions keeping track of such things is extremely difficult. TMW has started recently with a note in the documentation of when a given function was introduced, but it's not in any database I'm aware of nor is there any searchable database/lookup function to make the backwards correlation of functions to their associated product.
However, there is one thing that helps for your specific case
doc largescale
finds the keyword in the Release Notes and it appears to be a release issue; the parameter name was changed.

  0 Comments

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by