DSP Blockset    

Exporting a Sample-Based Signal Using the To Workspace Block

Recall that a sample-based signal with M*N channels is represented by a sequence of M-by-N matrices. (The special case of M = N = 1 represents a single-channel signal.) When the input to the To Workspace block is a sample-based signal (and the Save format parameter is set to Array), the block creates an M-by-N-by-P array in the MATLAB workspace containing the P most recent samples from each channel. The number of pages, P, is specified by the Limit data points to last parameter. The newest samples are added at the back of the array.

The figure below illustrates this for a 6-by-4 sample-based signal exported to workspace array A.

The workspace array always has time running along its third (P) dimension. Samples are saved along the P dimension whether the input is a matrix, vector, or scalar (single channel).

The following example illustrates how the To Workspace block can be used to export a sample-based matrix signal to the MATLAB workspace.

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.

Array A represents a four-channel signal with 100 samples.

Specify the following parameter values in the Signal From Workspace block:

Specify the following parameter values in the To Workspace block:

Run the model, and look at output yout. The first four samples (pages) are shown below:


  Exporting Multichannel Signals Exporting a Frame-Based Signal Using the To Workspace Block