Hauptinhalt

bdIsDirty

R2026b

Check whether model, library, or subsystem has unsaved changes

Description

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

example

Examples

collapse all

Suppose you have two models, named myModel1 and myModel2, respectively.

Check whether the models have unsaved changes.

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

Both models have unsaved changes.

Input Arguments

collapse all

One or more models, libraries, or subsystems saved in their own files to check, specified as handles or names. Format handles as numeric scalars or numeric arrays. Format names as string, string arrays, character vectors, or cell arrays of character vectors.

Checking whether blocks, such as Subsystem blocks, have unsaved changes is not supported. You can check whether referenced subsystems have unsaved changes. For more information, see Create and Use Referenced Subsystems in Models.

For information about getting handles and paths, see Get Handles and Paths.

Example: "myModel"

Example: ["myModel1","myModel2"]

Data Types: double | array of doubles | 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 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.

Data Types: logical

Version History

Introduced in R2017a