User`s guide

3 Working with Signals
3-64
containing M consecutive samples. In other words, the workspace matrix must
be oriented so as to have the independent channels as its columns.
When the block has output all of the rows available in the specified variable, 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. This behavior is controlled
by the
Form output after final data value by parameter. See the Signal From
Workspace reference page for more information.
The following example illustrates how the Signal From Workspace block can be
used to import a sample-based vector signal into a model.
Example: Importing a Sample-Based Vector Signal. In the model below, the Signal
From Workspace creates a three-channel sample-based signal with the
following data:
Channel 1: 1, 2, 3, 4, 5,..., 100, 0, 0, 0,...
Channel 2: -1, -2, -3, -4, -5,..., -100, 0, 0, 0,...
Channel 3: 5, 5, 5, 5, 5,..., 0, 0, 0,...
To create the model, define the following variables at the MATLAB command
line
A = [1:100;-1:-1:-100]'; % 100-by-2 matrix
B = 5*ones(100,1); % 100-by-1 column vector
Matrix A represents a two-channel signal with 100 samples, and matrix B
represents a one-channel signal with 100 samples.
Specify the following parameter values in the Signal From Workspace block:
Signal = [A B]
Sample time = 1
Samples per frame = 1
Four consecutive samples from a
3-channel sample-based signal
[1 -1 5][2 -2 5][3 -3 5][4 -4 5]
t=0t=1t=2t=3