Simulink Reference Previous page   Next Page
Simulink.ModelWorkspace

Describe a model workspace.

Description

Instances of this class describe model workspaces. Simulink creates an instance of this class for each model that you open during a Simulink session. See Working with Model Workspaces for more information.

Property Summary

Name
Access
Description
DataSource
RW
Specifies the source used to initialize this workspace. Valid values are
  • 'MDL-File'
  • 'MAT-File'
  • 'M-Code'
FileName
RW
Specifies the name of the MAT-file used to initialize this workspace. Simulink ignores this property if DataSource is not 'MAT-File'.
MCode
RW
A string specifying M code used to initialize this workspace. Simulink ignores this property if DataSource is not 'M-Code'.

Method Summary

Name
Description
assignin
Assign a value to a variable in the model's workspace.
clear
Clear the model's workspace.
evalin
Evaluate an expression in the model's workspace.
reload
Reload the model workspace from the workspace's data source..
save
Save the model's workspace to a specified MAT-file.
saveToSource
Save the workspace to the MAT-file that the workspace designates as its data source.
whos
List the variables in the model workspace..

Methods


assignin

Purpose:   Assign a value to a variable in the model's workspace.

Syntax:   assignin('varname', varvalue)

Arguments:   
  

Description:   This method assigns the value specified by varvalue to the variable whose name is varname.

See also:   evalin



clear

Purpose:   Clear the model's workspace.

Syntax:   clear

Description:   This method empties the workspace of its variables.



evalin

Purpose:   Evaluate an expression in the model's workspace.

Syntax:   evalin('expression')

Arguments:   
  

Description:   This method evalues expression in the model workspace.

See also:   assignin



reload

Purpose:   Reload the model workspace from the workspace's data source.

Syntax:   reload

Description:   This method reloads the model workspace from the data source specified by its DataSource parameter.

See also:   saveToSource



save

Purpose:   Save the model's workspace to a specified MAT-file.

Syntax:   save('filename')

Arguments:   
  

Description:   This method saves the model's workspace to the MAT-file specified by filename.

Example:   

See also:   reload, saveToSource



saveToSource

Purpose:   Save the workspace to the MAT-file that it designates as its data source.

Syntax:   saveToSource

Description:   This method saves the model workspace designated by its FileName property.

Example:   

See also:   save, reload



whos

Purpose:   List the variables in the model workspace.

Syntax:   whos

Description:   This method lists the variables in the model's workspace. The listing includes the size and class of the variables.

Example:   


Previous page  Simulink.ModelDataLogs Simulink.MSFcnRunTimeBlock Next page

© 1994-2005 The MathWorks, Inc.