Load signal data from workspace
Simulink / Sources
The From Workspace block reads signal data from a workspace and provides the data at its output as a signal.
The block displays the expression specified in the Data parameter. For details about how the expression gets evaluated, see Symbol Resolution.
You can specify how the data is loaded, including sample time, how to handle data for missing data points, and whether to use zero-crossing detection. For more information, see Load Data Using the From Workspace Block.
Note
Simulink® Coder™ software does not generate code for this block when connected to the Sim port under the conditions listed in Environment Controller.
In the From Workspace block dialog box, use the Data parameter to specify the workspace data to load. You can specify a MATLAB® expression (for example, the name of a variable in the MATLAB workspace) that evaluates to one of these options:
A timeseries
object
A structure of timeseries
objects
A timetable
object
A structure of timetable
objects
A structure, with or without time
A two-dimensional matrix
For additional information, see Load Data Using the From Workspace Block.
Note
When you specify timetable
data to load, each
timetable
object can contain data for only one
signal.
When you link a model to a data dictionary, you:
Store design data, which contributes to the fundamental design of the
model in the Design Data section of the dictionary. Design data includes
numeric variables and Simulink.Parameter
objects that you use to set block
parameter values.
Store simulation input data, which you use to stimulate and experiment
with the model, in the base workspace. Typically, you create simulation
input data as MATLAB
timeseries
objects.
For more information about storing variables, objects, and other data that a model uses, see Determine Where to Store Variables and Objects for Simulink Models.
To access design data by using a From Workspace block, store the target variable in the Design Data section of the dictionary and set the Data parameter of the block to the name of the variable.
To access simulation input data, store the target variable in the base
workspace and set the Data parameter by using a
call to the evalin
function. In the call to
evalin
, specify the ws
argument as 'base'
so that the block seeks the
variable in the base workspace instead of the data dictionary. For
example, if the name of the variable is
myTimeseriesObject
, set Data
to evalin('base','myTimeseriesObject')
.
Environment Controller | From File | From Spreadsheet | To File | To Workspace