| 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 arraysig2 = reshape(-1:-1:-100,[1 1 100])% 1-by-1-by-100 arraysig3 = zeros(1,1,100)% 1-by-1-by-100 arraysig4 = 5*ones(1,1,100)% 1-by-1-by-100 arraysig12 = cat(2,sig1,sig2)% 1-by-2-by-100 arraysig34 = cat(2,sig3,sig4)% 1-by-2-by-100 arrayA = 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:
A11Specify the following parameter values in the To Workspace block:
youtinf1-1Run 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 | ![]() |