| Using Simulink | ![]() |
The Model Workspace Dialog Box enables you to specify a model workspace's source and model reference arguments. To display the dialog box, select the model workspace in the Model Explorer's Model Hierarchy pane.
The dialog box contains the following controls.
Data source
Specifies the source of this workspace's data. The options are
Specifies that the data source is the model itself. Selecting this option causes additional controls to appear (see MDL-File Source Controls).
Specifies that the data source is a MAT file. Selecting this option causes additional controls to appear (see MAT-File Source Controls).
Specifies that the data source is M code stored in the model file. Selecting this option causes additional controls to appear (see M-Code Source Controls).
MDL-File Source Controls
Selecting Mdl-File as the Data source for a workspace causes the Model Workspace dialog box to display additional controls.
Import From MAT-File. This button lets you import data from a MAT-file. Selecting the button causes Simulink to display a file selection dialog box. Use the dialog box to select the MAT file that contains the data you want to import.
Export To MAT-File. This button lets you save the selected workspace as a MAT-file. Selecting the button causes Simulink to display a file selection dialog box. Use the dialog box to select the MAT file to contain the saved data.
Clear Workspace. This button clears all data from the selected workspace.
MAT-File Source Controls
Selecting MAT-File as the Data source for a workspace causes the Model Workspace dialog box to display additional controls.
File name. File name or path name of the MAT file that is the data source for the selected workspace. If a file name, the name must reside on the MATLAB path.
Reinitialize From Source. Clears the workspace and reloads the data from the MAT-file specified by the File name field.
Save To Source. Save the workspace in the MAT-file specified by the File name field..
Import From MAT-File. Loads data from a specified MAT file into the selected model workspace without first clearing the workspace. Selecting this option causes Simulink to display a file selection dialog box. Use the dialog box to enter the name of the MAT-file that contains the data to be imported.
Export To MAT-File. Saves the data in the selected workspace in a MAT-file. Selecting the button causes Simulink to display a file selection dialog box. Use the dialog box to select the MAT file to contain the saved data.
Clear Workspace. Clears the selected workspace.
M-Code Source Controls
Selecting M-Code as the Data source for a workspace causes the Model Workspace dialog box to display additional controls.
M-Code. Specifies M-code that initializes the selected workspace. To change the initialization code, edit this field, then select the Reinitialize from source button on the dialog box to clear the workspace and execute the modified code.
Reinitialize from Source. Clears the workspace and executes the contents of the M-Code field.
Import From MAT-File. Loads data from a specified MAT file into the selected model workspace without first clearing the workspace. Selecting this option causes Simulink to display a file selection dialog box. Use the dialog box to enter the name of the MAT-file that contains the data to be imported.
Export To MAT-File. Saves the data in the selected workspace in a MAT-file. Selecting the button causes Simulink to display a file selection dialog box. Use the dialog box to select the MAT file to contain the saved data.
Clear Workspace. Clears the selected workspace.
Model Arguments
This field allows you to specify arguments that can be passed to instances of this model referenced by another model. See Using Model Arguments for more information.
| Changing Model Workspace Data | Working with Data Stores | ![]() |
© 1994-2005 The MathWorks, Inc.