Simulink Reference | ![]() ![]() |
Library
Description
The From Workspace block reads data from the MATLAB workspace. The block's Data parameter specifies the workspace data via a MATLAB expression that evaluates to a matrix (2-D array) or a structure containing an array of signal values and time steps. The format of the matrix or structure is the same as that used to load inport data from the workspace (see Loading Input from the Base Workspace"). The From Workspace icon displays the expression in the Data parameter.
Note You must use the structure-with-time format to load matrix (2-D) data from the workspace. You can use either the array or the structure format to load scalar or vector (1-D) data. |
The From Workspace block's Interpolate data parameter determines the block's output in the time interval for which workspace data is supplied. If the Interpolate data option is selected, the block interpolates between data values for time steps that occur between the times for which data is supplied from the workspace. Otherwise, the block uses the most recent data value supplied from the workspace.
The block's Form output after final data value by parameter determines the block's output after the last time step for which data is available from the workspace. The following table summarizes the output block based on the options that the parameter provides.
If the input array contains more than one entry for the same time step, Simulink uses the signals specified by the last entry. For example, suppose the input array has this data:
At time 2, the output is 5, the signal value for the last entry for time 2.
Note
A From Workspace block can directly read the output of a To Workspace block (see To Workspace ) if the output is in structure-with-time format (see Loading Input from the Base Workspace for a description of these formats). |
Data Type Support
A From Workspace block accepts real or complex signals of any type except int64
and uint64
from the workspace. Real signals of type double
can be in either structure or matrix format. Complex signals and real signals of any type other than double
must be in structure format.
Parameters and Dialog Box
T
and a vector of corresponding signal values named U
. Entering the expression [T,U]
for this parameter yields the required input array. If the required signal-versus-time array or structure already exists in the workspace, enter the name of the structure or matrix in this field.Characteristics
Sample Time |
Inherited from driven block |
Scalar Expansion |
No |
Dimensionalized |
Yes |
Zero Crossing |
No |
![]() | From File | Function-Call Generator | ![]() |