User`s guide
Creating Signals
3-39
For more information about creating signals, see the following sections:
•“Creating Signals Using Constant Blocks” on page 3-33
•“Creating Signals Using Signal Generator Blocks” on page 3-36
Example 1: Generating Sample-Based Output
In the model below, the Signal From Workspace creates a four-channel
sample-based signal with the following data:
•
Channel 1: 1, 2, 3, 0, 0,...
•
Channel 2: -1, -2, -3, 0, 0,...
•
Channel 3: 0, 0, 0, 0, 0,...
•
Channel 4: 5, 5, 5, 0, 0,...
To create the model, specify the following parameter values in the Signal From
Workspace block:
•
Signal = cat(3,[1 -1;0 5],[2 -2;0 5],[3 -3;0 5])
•Sample time = 1
•Samples per frame = 1
•Form output after final data value = Setting to zero
The Sample time setting of 1 yields a sample-based output with sample period
of 1 second. Each of the four elements in the matrix signal represents an
independent channel (the channel numbering is arbitrary). The
Form output
after final data value
parameter setting specifies that all outputs after the
third are zero.
Example 2: Generating Frame-Based Output
In the model below, the Signal From Workspace creates a two-channel
frame-based signal with the following data:
11–
05
22–
05
first matrix output
t=0t=1
33–
05
t=2
00
00
t=3