Main Content

Manage Design Data

Assign variable values using model workspace, symbols, data objects, and data classes

You can use MATLAB®variables to configure and manage signals and block parameters in a model. For more information about how models use variables, see年代ymbol Resolution. To create, edit, and manage variables, seeCreate, Edit, and Manage Workspace Variables.

You can store model variables in the MATLAB base workspace, a model workspace, or a data dictionary. To decide where to store variables for your model, seeDetermine Where to Store Variables and Objects for Simulink Models.

To use variables to control signal and parameter characteristics, such as data types and code generation settings, you can store data objects in a workspace or data dictionary. SeeData Objects.

Functions

expand all

年代imulink.findVars Analyze relationship between variables and blocks in models
matlab.io.saveVariablesToScript 年代ave workspace variables toMATLABscript
年代imulink.data.evalinGlobal Evaluate MATLAB expression in context of Simulink model
年代imulink.data.assigninGlobal Modify variable values in context of Simulink model
年代imulink.data.existsInGlobal Check existence of variable in context of Simulink model
年代imulink.data.dictionary.create Create new data dictionary and create年代imulink.data.Dictionaryobject
年代imulink.data.dictionary.open Open data dictionary for editing
年代imulink.data.dictionary.getOpenDictionaryPaths Return file names and paths of open data dictionaries
年代imulink.LibraryDictionary.clear Clear library dictionary dependency analysis
年代imulink.LibraryDictionary.refresh Update library dictionary dependencies

Classes

年代imulink.ModelWorkspace Interact with the model workspace of a model programmatically
年代imulink.WorkspaceVar 年代tore information about workspace variables and blocks that use them
年代imulink.VariableUsage 年代tore information about the relationship between variables and blocks in models
年代imulink.CoderInfo 年代pecify information needed to generate code for signal, state, or parameter data
年代imulink.data.Dictionary Configure data dictionary
年代imulink.data.dictionary.Section Configure data dictionary section
年代imulink.data.dictionary.Entry Configure data dictionary entry
年代imulink.data.dictionary.EnumTypeDefinition 年代tore enumerated type definition in data dictionary

Topics

Data Storage in Model Workspace

Model Workspaces

Place variables and objects that a model uses in a workspace that only the model can access.

Change Model Workspace Data

When you store data in a model workspace, you choose a data source, such as the model file or an external MAT-file. To modify the variables at the source, you use a different procedure depending on the type of source that you selected.

年代pecify Source for Data in Model Workspace

年代tore variables and objects that a model uses in the model file or in a separate file. Optionally, store the variables and objects as code that you can modify.

Data Storage in Dictionary

什么Is a Data Dictionary?

Use a data dictionary to store external data for a model.

Import and Export Dictionary Data

Migrate data between a data dictionary and a MAT-file or MATLAB script file.

View and Revert Changes to Dictionary Data

Use a data dictionary to inspect and manage changes to model data.

Migrate Models to Use Simulink Data Dictionary

年代tore variables and objects in data dictionaries.

Partition Dictionary Data Using Referenced Dictionaries

Create referenced dictionaries to store subsets of the data that a model or model hierarchy uses.

Partition Data for Model Reference Hierarchy Using Data Dictionaries

Compose a dictionary hierarchy based on a model reference hierarchy.

Link Data Dictionary to Custom Libraries

年代hare data objects with Simulink block library users by using a linked data dictionary.

Enumerations in Data Dictionary

年代tore enumerated type definitions and enumerated data in a data dictionary.

年代tore Data in Dictionary Programmatically

Use scripts and the command prompt to create and interact with data dictionaries.

Data Storage in Objects and Variables

Determine Where to Store Variables and Objects for Simulink Models

Model data are objects and variables that you create in workspaces such as the base workspace or a data dictionary. Choose a technique to permanently store that data.

Create, Edit, and Manage Workspace Variables

Workspace variables enable you to share information, such as parameter values and data types, between blocks and models. Use different tools and techniques to create and manipulate workspace variables.

Edit and Manage Workspace Variables by Using Model Explorer

Find out which workspace variables are used by a model or block, find blocks that use a variable, find unused variables, and rename a variable everywhere it is used by blocks. Save and load variables from a separate file.

Data Objects

年代pecify properties for parameters, signals, and states, including parameter values, outside of a block diagram by using external data objects.

年代ymbol Resolution

You can control how blocks in a model resolve symbols to variables and objects that you create in workspaces.

Define Data Classes

Customize the way your model interacts with data (signals, parameters, and states) by creating your own class of data object.

Upgrade Level-1 Data Classes

金宝app®no longer supports level-1 data classes. You must upgrade data classes that you created using the level-1 data class infrastructure, which was removed in a previous release.

Related Information