Main Content

hasUnsavedChanges

Determine whether connected data source has unsaved data in memory

Since R2024a

    Description

    hasUnsavedChanges(connectionObj) returns 1 (true) if the connected data source connectionObj has unsaved data in memory, and 0 (false) otherwise.

    example

    Examples

    collapse all

    dd = Simulink.data.connect("myDictionary.sldd");
    dd.x = dd.x + 2;
    dirty = hasUnsavedChanges(dd)
    dirty = 
    
    logical
        1
    

    Input Arguments

    collapse all

    Connection to data source, specified as a Simulink.data.DataConnection object.

    Version History

    Introduced in R2024a