| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Signal Processing Blockset |
| Contents | Index |
| Learn more about Signal Processing Blockset |
Signal Processing Sources
dspsrcs4
The Signal From Workspace block imports a signal from the MATLAB workspace into the Simulink model. The Signal parameter specifies the name of a MATLAB workspace variable containing the signal to import, or any valid MATLAB expression defining a matrix or 3-D array.
When the Signal parameter specifies an M-by-N matrix (M≠1), each of the N columns is treated as a distinct channel. You specify the frame size in the Samples per frame parameter, Mo, and the output is an Mo-by-N matrix containing Mo consecutive samples from each signal channel. You specify the output sample period in the Sample time parameter, Ts, and the output frame period is Mo*Ts. For Mo=1, the output is sample based; otherwise the output is frame based. For convenience, an imported row vector (M=1) is treated as a single channel, so the output dimension is Mo-by-1.
When the Signal parameter specifies an M-by-N-by-P array, each of the P pages (an M-by-N matrix) is output in sequence with period Ts. The Samples per frame parameter must be set to 1, and the output is always sample based.
Unlike the Simulink From Workspace block, the Signal From Workspace block holds the output value constant between successive output frames (that is, no linear interpolation takes place). Additionally, the initial signal values are always produced immediately at t=0.
When the block has output all of the available signal samples, it can start again at the beginning of the signal, or simply repeat the final value or generate zeros until the end of the simulation. (The block does not extrapolate the imported signal beyond the last sample.) The Form output after final data value by parameter controls this behavior:
When you specify Setting To Zero, the block generates zero-valued outputs for the duration of the simulation after generating the last frame of the signal.
When you specify Holding Final Value, the block repeats the final sample for the duration of the simulation after generating the last frame of the signal.
When you specify Cyclic Repetition, the block repeats the signal from the beginning after it reaches the last sample in the signal. If the frame size you specify in the Samples per frame parameter does not evenly divide the input length, a buffer block is inserted into the Signal From Workspace subsystem, and the model becomes multirate. If you do not want your model to become multirate, make sure the frame size evenly divides the input signal length.
Select the Warn when frame size does not evenly divide input length parameter to be alerted when the input length is not an integer multiple of the frame size and your model will become multirate. Use the Model Explorer to turn these warnings on or off model-wide:
Select Model Explorer from the View menu in your model.
In the Search bar of the Model Explorer, search by Property Name for the ignoreOrWarnInputAndFrameLengths property. Each block with the Warn when frame size does not evenly divide input length check box appears in the list in the Contents pane.
Select each of the blocks for which you wish to toggle the warning parameter, and select or deselect the check box in the ignoreOrWarnInputAndFrameLengths column.
In the first model below, the Signal From Workspace imports a two-channel signal from the workspace matrix A. The Sample time is set to 1 and the Samples per frame is set to 4, so the output is frame based with a frame size of 4 and a frame period of 4 seconds. The Form output after final data value by parameter specifies Setting To Zero, so all outputs after the third frame (at t=8) are zero.

In the second model below, the Signal From Workspace block imports a sample-based matrix signal from the 3-D workspace array A. Again, the Form output after final data value by parameter specifies Setting To Zero, so all outputs after the third (at t=2) are zero.

The Samples per frame parameter is set to 1 for 3-D input.

The name of the MATLAB workspace variable from which to import the signal, or a valid MATLAB expression specifying the signal.
The sample period, Ts, of the output. The output frame period is Mo*Ts.
The number of samples, Mo, to buffer into each output frame. This value must be 1 when you specify a 3-D array in the Signal parameter.
Specifies the output after all of the specified signal samples have been generated. The block can output zeros for the duration of the simulation (Setting to zero), repeat the final data sample (Holding Final Value) or repeat the entire signal from the beginning (Cyclic Repetition).
Select this parameter to be alerted when the input length is not an integer multiple of the frame size and your model will become multirate. For more information, see Initial and Final Conditions.
This parameter is only visible when Cyclic Repetition is selected for the Form output after final data value by parameter.
Double-precision floating point
Single-precision floating point
Fixed point (signed and unsigned)
8-, 16-, and 32-bit signed integers
8-, 16-, and 32-bit unsigned integers
| From Audio Device | Signal Processing Blockset |
| From Wave File | Signal Processing Blockset |
| Signal From Workspace | Signal Processing Blockset |
| From Workspace | Simulink |
| To Workspace | Simulink |
| Triggered Signal From Workspace | Signal Processing Blockset |
See the sections below for related information:
![]() | Short-Time FFT | Signal To Workspace | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |