How do I tell which toolboxes my program uses?

548 views (last 30 days)
Does anyone know of a quick way to test which toolboxes are used in a set of code. I have a large project (spread accross different functions), and I can't remember what toolboxes I had available when I wrote it.
I only have the basic install of MATLAB at my new company and need to figure out which toolboxes to buy. I can identify one because the code crashes when it hits a particular function, but can't easiy find out if there are others.
Perhaps there is a script out there to search the text and compare it against a list of functions in the different toolboxes?
  1 Comment
Walter Roberson
Walter Roberson on 28 Jan 2011
Does your code have any instances in which the name of the function was given as a string, such as a callback specified as a string, or instances of eval() or evalin() ?

Sign in to comment.

Accepted Answer

Andreas Goser
Andreas Goser on 28 Jan 2011
There are a couple of things to try and consider. First, you can run code on a machine that has the necessary products (e.g. a trial version) and after running the code execute:
and it will return what products you have used. With the exception of the point Walter mentione in his comment (in case the code uses EVAL), this is a save method.
Then there is the DEPFUN command that lists dependencies. I have seen users work with that, but you need to have a good understanding of the function names and to which product they belong. You may need to do research and it is error-prone.
  1 Comment
Jiro Doke
Jiro Doke on 2 Feb 2011
Wouldn't "licence inuse" catch calls to EVAL as well? EVAL operations would also check out the appropriate license, so it should be pretty robust.

Sign in to comment.

More Answers (3)

Subin Kuttappan Stellal Mary
matlab.codetools.requiredFilesAndProducts will list all the toolboxes used in the m script.
Walter Roberson
Walter Roberson on 6 Mar 2019
license('inuse') only catches licenses that have been invoked in this session. requiredFilesAndProducts analyses to find anything that might be invoked.

Sign in to comment.

Andrew Newell
Andrew Newell on 28 Jan 2011
You could do a dependency report for each folder that your code is in (from the menu in the Current Folder window). The toolboxes will be apparent from the locations of the functions.

Oleg Komarov
Oleg Komarov on 28 Jan 2011

There is also a very useful submission by Us FDEP: function dependencies finder which detects calls to evalin also.



shows the dependencies in a GUI (here's just a preview):



Find more on Startup and Shutdown 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!

Translated by