Main Content


Determine whether model, subsystem, or library is loaded



tf = bdIsLoaded(bd) returns whether the specified model, subsystem, or library is loaded.


collapse all

Check One Model

Open the example. Then, load the vdp model.


Check whether the vdp model is loaded.

ans = logical

The function returns a logical scalar, 1, which indicates that the model is loaded.

Check Multiple Models

You can check whether multiple models are loaded with a single function call.

Check whether the vdp and f14 models are loaded. Specify the models to check as a cell array of character vectors.

ans = 1x2 logical array

   1   0

The function returns the logical array [1 0], which indicates that the vdp model is loaded but the f14 model is not loaded.

Input Arguments

collapse all

Name of model, subsystem, or library, specified as a string array, character vector, or cell array of character vectors.

Blocks, such as Subsystem blocks, cannot be loaded independently. Referenced subsystems can be loaded independently. For more information, see Create and Use Referenced Subsystems in Models.

Data Types: char | string | cell

Output Arguments

collapse all

True or false result, returned as a 1 or 0 of data type logical.

  • 1 (true) — File is loaded.

  • 0 (false) — File is not loaded.

When multiple files are specified, the function returns a logical array with one entry for each file.

Version History

Introduced in R2008a