Main Content

bdIsDirty

Determine whether model, subsystem, or library has unsaved changes

Description

example

tf = bdIsDirty(bd) returns whether the specified model, subsystem, or library has unsaved changes. Unsaved changes can include changes to the block diagram, configuration parameters, or properties.

Examples

collapse all

Check if models contain unsaved changes using bdIsDirty.

Check if a single model is dirty.

vdp
bdIsDirty('vdp')
ans =

  logical

   0

Check if multiple models are dirty.

vdp
sf_car
bdIsDirty({'sf_car','vdp'})
ans =

  1×2 logical array

   0   0

Input Arguments

collapse all

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

You cannot check whether blocks, such as Subsystem blocks, have unsaved changes. You can check whether referenced subsystems have unsaved changes. For more information, see Subsystem Reference.

Data Types: double | char | string | cell

Output Arguments

collapse all

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

  • 1 (true) — File has been modified in memory since it was loaded or last saved.

  • 0 (false) — File has no unsaved changes.

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

Introduced in R2017a