Main Content

bdIsLoaded

Determine whether model, subsystem, or library is loaded

Description

example

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

Examples

collapse all

Check whether the f14 model is loaded.

bdIsLoaded('f14')
ans =

  logical

   0

The function returns a logical scalar, 0, which indicates that the file is not loaded.

To load the f14 model, use the load_system function.

load_system('f14')

Determine whether the f14 and vdp models are loaded.

bdIsLoaded({'f14','vdp'})
ans =

  1×2 logical array

   1   0

The function returns a 1-by-2 logical array, which indicates that the first model in the cell array (f14) is loaded and the second model in the cell array (vdp) is not loaded.

To load the vdp model, use the load_system function.

load_system('vdp')

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 Subsystem Reference.

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