Documentation Center

  • Trials
  • Product Updates

dependencies.fileDependencyAnalysis

Find model file dependencies

Syntax

files = dependencies.fileDependencyAnalysis('modelname')
[files, missing] = dependencies.fileDependencyAnalysis('modelname')
[files, missing, depfile] = dependencies.fileDependencyAnalysis('modelname')
[files, missing, depfile, manifestfile] = dependencies.fileDependencyAnalysis('modelname', 'manifestfile')

Description

files = dependencies.fileDependencyAnalysis('modelname') returns files, a cell array of strings containing the full paths of all existing files referenced by the model modelname.

[files, missing] = dependencies.fileDependencyAnalysis('modelname') returns files, all existing files referenced by the model modelname, and any referenced files that cannot be found in missing.

[files, missing, depfile] = dependencies.fileDependencyAnalysis('modelname') also returns depfile, the full path of the user dependencies (.smd) file, if it exists, that stores the names of any files you manually added or excluded.

[files, missing, depfile, manifestfile] = dependencies.fileDependencyAnalysis('modelname', 'manifestfile') also creates a manifest file with the name and path specified in manifestfile.

Input Arguments

modelname

String specifying the name of the model to analyze for dependencies.

manifestfile

(Optional) String to specify the name of the manifest file to create. You can specify a full path or just a file name (in which case the file is created in the current folder). The function adds the suffix .smf to the user-specified name.

Output Arguments

files

A cell array of strings containing the full-paths of all existing files referenced by the model modelname.

Default: [ ]

missing

A cell array of strings containing the names of any files that are referenced by the model modelname, but cannot be found.

Default: [ ]

depfile

String containing the full path of a user dependencies (.smd) file, if it exists, that stores the names of any files you manually added or excluded. Simulink® uses the .smd file to remember your changes the next time you generate a manifest. See Edit Manifests.

Default: [ ]

manifestfile

String containing the name and path of the new manifest file.

Default: [ ]

Examples

The following code analyses the model mymodel for file dependencies:

files = dependencies.fileDependencyAnalysis('mymodel')

If you try dependency analysis on an example model, it returns an empty list of required files because the standard MathWorks® installation includes all the files required for the example models.

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, find required toolboxes, and for more control over dependency analysis options, you can interactively generate a manifest and report. See Analyze Model Dependencies.

To programmatically check which toolboxes are required, see dependencies.toolboxDependencyAnalysis.

More About

expand all

Tips

If you try dependency analysis on an example model, it returns an empty list of required files because the standard MathWorks installation includes all the files required for the example models.

See Also

Was this topic helpful?