User`s guide
Exporting Signals
3-75
To create the model, define the following variables at the MATLAB command
line.
sig1 = reshape(1:100,[1 1 100]) % 1-by-1-by-100 array
sig2 = reshape(-1:-1:-100,[1 1 100]) % 1-by-1-by-100 array
sig3 = zeros(1,1,100) % 1-by-1-by-100 array
sig4 = 5*ones(1,1,100) % 1-by-1-by-100 array
sig12 = cat(2,sig1,sig2) % 1-by-2-by-100 array
sig34 = cat(2,sig3,sig4) % 1-by-2-by-100 array
A = cat(1,sig12,sig34) % 2-by-2-by-100 array
Array A represents a four-channel signal with 100 samples.
Specify the following parameter values in the Signal From Workspace block:
•
Signal = A
•Sample time = 1
•Samples per frame = 1
•Form output after final data value = Setting to zero
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 four samples (pages) are
shown below.
Four consecutive samples from a
4-channel sample-based signal
11–
05
22–
05
first matrix output
t=0t=1
33–
05
t=2t=3
44–
05