Contenu principal

bdIsLoaded

R2026b

Check whether model, library, or subsystem is loaded

Description

tf = bdIsLoaded(bd) returns whether the specified model, library, or subsystem saved in its own file is loaded.

example

Examples

collapse all

Suppose you have two models named myModel1 and myModel2.

Check whether the models are loaded.

bdIsLoaded(["myModel1","myModel2"])
ans = 1×2 logical array
1	0

myModel1 is loaded, and myModel2 is not.

Input Arguments

collapse all

Names of one or more models, libraries, or subsystems saved in their own files that you want to check, specified as a string, 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.

Example: "myModel"

Example: ["myModel1","myModel2"]

Data Types: string | string array | character vector | cell array of character vectors

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.

Data Types: logical | logical array

Version History

Introduced in R2008a