MATLAB: How to determine which toolboxes the MATLAB code uses

I use some MATLAB code that is dependent on one or more toolboxes, and would like to install the bare minimum number of toolboxes onto another machine to allow this code to be used. Is there a way to determine which toolboxes are being used without going through my code on a line-by-line basis? 

Best Answer

When MATLAB encounters code that uses a toolbox, it must check out a license for that toolbox. These licenses are then held until the MATLAB session ends.
To determine which toolboxes your code uses, open MATLAB and execute the code. Once completed, run the following command in MATLAB:
>> license('inuse')
This command should return a list of all product licenses that are checked out. You can learn more about this command here: