User`s guide
3 Working with Signals
3-78
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
The Sample time setting of 1 and Samples per frame setting of 4 yield a
frame-based output with sample period of 1 second and frame period of
4 seconds.
Specify the following parameter values in the To Workspace block:
•
Variable name = yout
•Limit data points to last = inf
•Decimation = 1
•Sample time = -1
•Save format = Array
Run the model, and look at output yout. The first 10 samples (rows) are shown.
yout =
1 -1 5
2 -2 5
3 -3 5
4 -4 5
5 -5 5
6 -6 5
7 -7 5
8 -8 5
9 -9 5
10 -10 5