DSP Blockset | ![]() ![]() |
Example: Importing a Sample-Based Matrix Signal. In the model below, the Signal From Workspace imports a four-channel sample-based signal with the following data:
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 4-channel signal with 100 samples.
Specify the following parameter values in the Signal From Workspace block:
A
1
1
The Sample time and Samples per frame settings of 1
yield a sample-based output with sample period of 1 second. Each of the four elements in the matrix represents an independent channel. The Form output after final data value parameter setting specifies that all outputs after the one-hundredth are zero.
These two sections may also be of interest to you:
![]() | Importing a Sample-Based Matrix Signal | Importing a Multichannel Frame-Based Signal | ![]() |