DSP Blockset | ![]() ![]() |
Example: Exporting a Sample-Based Matrix Signal. In the model below, the To Workspace block exports a four-channel sample-based signal with the following data:
The first four consecutive samples are shown in the figure.
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:
A
1
1
Specify the following parameter values in the To Workspace block:
yout
inf
1
-1
Run the model, and look at output yout
. The first four samples (pages) are shown below.
yout(:,:,1:4) ans(:,:,1) = 1 -1 0 5 ans(:,:,2) = 2 -2 0 5 ans(:,:,3) = 3 -3 0 5 ans(:,:,4) = 4 -4 0 5
![]() | Exporting a Sample-Based Signal Using the To Workspace Block | Exporting a Frame-Based Signal Using the To Workspace Block | ![]() |