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 sf_car model is loaded.

bdIsLoaded('sf_car')
ans =

  logical

   0

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

To load the sf_car model, use the load_system function.

load_system('sf_car')

Determine whether the sf_car and vdp models are loaded.

bdIsLoaded({'sf_car','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 (sf_car) 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.

Introduced in R2008a