How can I determine which functions in a MATLAB file originate from a specific toolbox?

30 views (last 30 days)
How can I determine which function originated the use of a MATLAB toolbox in my code files? 
For example, I execute the following:
>> [fList, pList] = matlab.codetools.requiredFilesAndProducts('Test.m')
>> plist(1,2).Name
ans = 
'Deep Learning Toolbox'
Calling "matlab.codetools.requiredFilesAndProducts" reports the toolboxes that are used but not the functions belonging to the toolboxes. How can I find out which function in my code is from 'Deep Learning Toolbox'?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Aug 2024
Edited: MathWorks Support Team on 14 Aug 2024
In order to determine the functions that originate the use of a toolbox, use one of the following two approaches depending on your MATLAB release:
 

Dependency Analyzer (R2020b and later)

In R2020b and later, the Dependency Analyzer app can list the products (toolboxes) used by MATLAB files, and allows you to examine where in these files the dependency is introduced. In the Products section, point to the product of interest and click the search folder icon:
You can then click on each line to navigate to the MATLAB file and see the respective function from that toolbox.
Alternatively, select Export > Generate Dependency Report, and inspect the "Required Products" section with links to navigate to the source code:
Note that until R2022b, the Dependency Analyzer is only available for MATLAB Projects. Starting in R2023a, you can access Dependency Analyzer from the MATLAB apps gallery to perform a dependency analysis on files and folders that do not belong to a project.

Legacy Tool: Dependency Report (R2022b and prior)

In older MATLAB releases, you can generate a Dependency Report from your current folder. This report identifies the toolboxes being used and the MATLAB functions files belonging to the toolboxes.
When the dependency report is generated it will produce lines such as the following:
Test | toolbox : \slrealtime\slrealtime\slrealtime.p
The 'slrealtime' folder name indicates that the object used in the MATLAB file "minimal_test" originated from the Simulink Real-Time toolbox.
To learn more about Dependency Reports, please see the "Dependencies Within a Folder" section at the following link: Identify Program Dependencies
This feature was removed in the release R2023a.

More Answers (0)

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!