Main Content


Remove specified variables from connected data source

Since R2024a



    clear(connectionObj,varNames) removes the specified variables from the connected data source. The function does not return an error if the variable does not exist.

    If the data connection can see multiple definitions of the same variable (for example, in a data dictionary and in a referenced dictionary), the function removes all definitions matching the specified variable names.


    collapse all

    dd ='myDictionary.sldd');
    clear(dd, 'x');
    mw ="myModel.slx");
    clear(mw,["y" "z"]);

    Input Arguments

    collapse all

    Connection to data source, specified as a object.

    Variable names to remove from connected data source, specified by a string, character vector, array of strings, or cell array of character vectors.

    Version History

    Introduced in R2024a