User`s guide
3 Working with Signals
3-70
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 is
used to import a frame-based multichannel signal into a model.
Example: Importing a Frame-Based Signal. In the model below, the Signal From
Workspace creates a three-channel frame-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,...
The frame size is four samples.
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 = 4
•Form output after final data value = Setting to zero
Three consecutive frames from a
3-channel frame-based signal
11– 5
22– 5
33– 5
44– 5
99– 5
10 10– 5
11 11– 5
12 12– 5
55– 5
66– 5
77– 5
88– 5
t=0t=4t=8