Main Content

Simulink.data.dataSource.removeSource

Remove external data source from model

Since R2024b

Description

Simulink.data.dataSource.removeSource(modelName,nameOfExternalSource) removes an external data source, such as a MAT file or a data dictionary, that is associated with the Simulink® model or Subsystem File specified by modelName. When you remove an external data source, the model no longer has access to the variables and data contained within the specified external file. The function does not delete the file.

example

Examples

collapse all

Remove an external data source from the model BasicModellingData.

Simulink.data.dataSource.removeSource("BasicModellingData","BasicModellingDataDefinitions.mat")

Remove myDictionary.sldd from the Subsystem File SSREF1.

Simulink.data.dataSource.removeSource("SSREF1","myDictionary.sldd")

Input Arguments

collapse all

Path or handle of a model or subsystem file, specified as a character vector or string.

Example: "myModel"

Data Types: char | string

Name of the external data source, specified as a character vector or string. Data source can be a MAT file or a data dictionary.

  • MAT file — Name of MAT file, including file extension

  • Data dictionary — Name of data dictionary, including file extension

Example: "myMatFile.mat"

Example: "myDictionary.sldd"

Data Types: char | string

Alternatives

Use Model Explorer to navigate to the External Data tab. Under Additional data sources, remove the data source from the model.

Version History

Introduced in R2024b