User`s guide
3 Working with Signals
3-88
Use the default settings for the Normalization, Digital Clock, Mux, and To
Workspace blocks, and adjust the Signal From Workspace block parameters as
follows:
•
Signal = 1:100
•Sample time = 1/4
•Samples per frame = 4
Select Sample-based from the Output signal menu in the Frame Status
Conversion block.
Note that the current value of the Simulink timer (from the Digital Clock block)
is prepended to each output frame. The frame-based signal is converted to a
sample-based signal by the Frame Status Conversion so that the output in the
command window will be more easily readable.
In the example, the Signal From Workspace block generates a new frame
containing four samples once every second (T
fo
=¼∗4). The first few output
frames are shown below.
(t=0)
[ 1 2 3 4]'
(t=1) [ 5 6 7 8]'
(t=2) [ 9 10 11 12]'
(t=3) [13 14 15 16]'
(t=4) [17 18 19 20]'
When you run the simulation, the normalized output, yout, is saved in a
workspace array. To convert the array to an easier-to-read matrix format, type
squeeze(yout)'
The first few samples of the result, ans, are shown below.
ans =
0 0.0333 0.0667 0.1000 0.1333
1.0000 0.0287 0.0345 0.0402 0.0460
2.0000 0.0202 0.0224 0.0247 0.0269
3.0000 0.0154 0.0165 0.0177 0.0189
4.0000 0.0124 0.0131 0.0138 0.0146
time