Quantcast

Documentation Center

  • Trial Software
  • Product Updates

dependencies.toolboxDependencyAnalysis

Find toolbox dependencies

Syntax

names = dependencies.toolboxDependencyAnalysis(files_in)
[names, folders] = dependencies.toolboxDependencyAnalysis(files_in)

Description

names = dependencies.toolboxDependencyAnalysis(files_in) returns names, a cell array of toolbox names required by the files in files_in.

[names, folders] = dependencies.toolboxDependencyAnalysis(files_in) returns toolbox names and also a cell array of the toolbox folders.

Input Arguments

files_in

Cell array of strings containing .m or .mdl files on the MATLAB® path. Simulink® model names (without file extension) are also allowed.

Default: [ ]

Output Arguments

names

Cell array of toolbox names required by the files in files_in.

folders

(Optional) Cell-array of the required toolbox folders.

Examples

The following code reports the detectable required toolboxes for the model vdp:

files_in={'vdp'};
names = dependencies.toolboxDependencyAnalysis(files_in)
names = 

    'MATLAB'    'Simulink'    'Simulink Coder'

To find all detectable toolbox dependencies of your model and the files it depends on:

  1. Call fileDependencyAnalysis on your model.

    For example:

    files = dependencies.fileDependencyAnalysis('mymodel')
    files = 
        'C:\Work\foo.m'
        'C:\Work\mymodel.mdl'
    
  2. Call toolboxDependencyAnalysis on the files output of step 1.

    For example:

    tbxes = dependencies.toolboxDependencyAnalysis(files)
    tbxes = 
    [1x24 char]    'MATLAB'    'Simulink Coder'    'Simulink'
    

    To view long product names examine the tbxes cell array as follows:

    tbxes{:}
    
    ans =
    Image Processing Toolbox
    
    ans =
    MATLAB
    
    ans =
    Simulink Coder
    
    ans =
    
    Simulink

Alternatives

You can interactively run dependency analysis from the Simulink project. See Choose Files and Run Dependency Analysis.

To create a report to identify where dependencies arise, and for more control over dependency analysis options, you can interactively generate a manifest and report. See Analyze Model Dependencies.

To programmatically check which files are required, see dependencies.fileDependencyAnalysis.

More About

expand all

Tips

The function dependencies.toolboxDependencyAnalysis looks for toolbox dependencies of the files in files_in but does not analyze any subsequent dependencies. See Examples.

For command-line dependency analysis, the analysis uses the default settings for analysis scope to determine required toolboxes. For example, if you have code generation products, then the check Find files required for code generation is on by default and Simulink Coder™ is always reported as required. See Required Toolboxes in the manifest documentation for more examples of how your installed products and analysis scope settings can affect reported toolbox requirements.

See Also

Was this topic helpful?