User`s guide
Signal From Workspace
5-388
5Signal From Workspace
Purpose Import a signal from the MATLAB workspace.
Library DSP Sources
Description The Signal From Workspace block imports a signal from the MATLAB
workspace into the Simulink model. The
Signal parameter specifies the name
of a MATLAB workspace variable containing the signal to import, or any valid
MATLAB expression defining a matrix or 3-D array.
When the
Signal parameter specifies an M-by-N matrix (M≠1), each of the N
columns is treated as a distinct channel. The frame size is specified by the
Samples per frame parameter, M
o
, and the output is an M
o
-by-N matrix
containing M
o
consecutive samples from each signal channel. The output
sample period is specified by the
Sample time parameter, T
s
, and the output
frame period is M
o
∗T
s
. For M
o
=1, the output is sample-based; otherwise the
output is frame-based. For convenience, an imported row vector (M=1) is
treated as a single channel, so the output dimension is M
o
-by-1.
When the
Signal parameter specifies an M-by-N-by-P array, each of the
P pages (an M-by-N matrix) is output in sequence with period T
s
. The Samples
per frame
parameter must be set to 1, and the output is always sample-based.
Initial and Final Conditions
Unlike Simulink’s From Workspace block, the Signal From Workspace block
holds the output value constant between successive output frames (i.e., no
linear interpolation takes place). Additionally, the initial signal values are
always produced immediately at t=0.
When the block has output all of the available signal samples, it can start again
at the beginning of the signal, or simply repeat the final value or generate zeros
until the end of the simulation. (The block does not extrapolate the imported
signal beyond the last sample.) The
Form output after final data value by
parameter controls this behavior:
•If
Setting To Zero is specified, the block generates zero-valued outputs for
the duration of the simulation after generating the last frame of the signal.
•If
Holding Final Value is specified, the block repeats the final sample for the
duration of the simulation after generating the last frame of the signal.