Main Content

simscape.dependency.lib

Namespace: simscape.dependency

Check dependencies for library package

Syntax

[fn_list, missing] = simscape.dependency.lib('libName')
[fn_list, missing] = simscape.dependency.lib('libName', dependencyType)
[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName')
[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName', isRecursive)
[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName', isRecursive, doTMWFile)

Description

[fn_list, missing] = simscape.dependency.lib('libName') returns two cell arrays of character vectors: full path names of existing dependency files, fn_list, and missing files, missing. These cell arrays list the existing and missing files that are needed for the specified Simscape™ library package to build successfully, or to correctly visualize and execute in MATLAB®.

[fn_list, missing] = simscape.dependency.lib('libName', dependencyType) returns dependency files of the specified type.

[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName') lets you specify the name of the library model. When not specified, or specified as an empty character vector (''), libName_lib is used.

[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName', isRecursive) lets you specify whether analysis is recursive on the generated dependency files. By default, returns only the top-level dependency files.

[fn_list, missing] = simscape.dependency.lib('libName', dependencyType, 'mdlFileName', isRecursive, doTMWFile) lets you specify whether to include files inside the MATLAB root folder (installation directory) in the analysis.

If the package contains Simscape protected files, with the corresponding Simscape source files in the same folder, the analysis returns the names of protected files and then analyzes the source files for further dependencies. If the package contains Simscape protected files without the corresponding source files, the protected file names are returned without further analysis.

Input Arguments

dependencyType

Enumerated value of type simscape.DependencyType, which specifies the type of returned files:

All (default)All the dependency files
AuxiliaryFiles that are not necessary to build the library, or run the models built from its blocks, but are needed to visualize it correctly, for example, block icon images or lib.m files.
CoreFiles necessary to build the library or run the models built from its blocks, such as Simscape files or MATLAB files.
DerivedInternally generated files that are not necessary for sharing the library, but including them will avoid rebuilding the library on the same platform.
SimulinkAdditional files that help visualize the blocks generated from the library components. These files are not necessary for simulation.

These enumerated values have the following order: Core, Derived, Auxiliary, Simulink, All. The return is accumulative. This means that for a requested file type, all earlier file types are also returned. For example, if you specify dependencyType as simscape.DependencyType.Derived, the analysis returns both Core and Derived files.

doTMWFile

Logical value that indicates whether the file analysis includes files inside the MATLAB root folder (installation directory):

true (default)
false

isRecursive

Logical value that indicates whether the analysis is recursive on the generated dependency files:

true
false (default)

libName

The name of a Simscape library package. The package folder name begins with a leading + character, whereas the argument to simscape.dependency.lib must omit the + character. You must run the command from the folder containing the top-level package, or from inside the package folder. In the latter case, you can omit the name of the library package if it is the only argument.

mdlFileName

The name of the library model (either without path, or with relative path, or with absolute path). The model file extension (.slx or .mdl) is optional.

Default: libName_lib

Version History

Introduced in R2009b