| DSP Blockset | ![]() |
Import signal samples from the MATLAB workspace when triggered
Library
Description
The Triggered Signal From Workspace block imports signal samples from the MATLAB workspace into the Simulink model when triggered by the control signal at the input port (
). 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. The frame size is specified by the Samples per frame parameter, Mo, and the output when triggered is an Mo-by-N matrix containing Mo consecutive samples from each signal channel. 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, the block generates a single page of the array (an M-by-N matrix) at each trigger time. The Samples per frame parameter must be set to 1, and the output is always sample based.
Trigger Event
The triggering event at the input port is specified by the Trigger type pop-up menu, and can be one of the following:
Rising edge triggers execution of the block when the trigger input rises from a negative value to zero or a positive value, or from zero to a positive value.
Falling edge triggers execution of the block when the trigger input falls from a positive value to zero or a negative value, or from zero to a negative value.
Either edge triggers execution of the block when either a rising or falling edge (as described above) occurs.
Initial and Final Conditions
The Initial output parameter specifies the output of the block from the start of the simulation until the first trigger event arrives. Between trigger events, the block holds the output value constant at its most recent value (that is, no linear interpolation takes place). For single-channel signals, the Initial output parameter value can be a vector of length Mo or a scalar to repeat across the Mo elements of the initial output frames. For matrix outputs (Mo-by-N or M-by-N), the Initial output parameter value can be a vector of length N to repeat across all rows of the initial outputs, or a scalar to repeat across all elements of the initial matrix outputs.
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:
Setting To Zero is specified, the block generates zero-valued outputs for the duration of the simulation after generating the last frame of the signal.
Holding Final Value is specified, the block repeats the final sample for the duration of the simulation after generating the last frame of the signal.
Cyclic Repetition is specified, the block repeats the signal from the beginning after generating the last frame. If there are not enough samples at the end of the signal to fill the final frame, the block zero-pads the final frame as necessary to ensure that the output for each cycle is identical (for example, the ith frame of one cycle contains the same samples as the ith frame of any other cycle).
Dialog Box
1 if a 3-D array is specified in the Signal parameter.
Setting to zero), repeat the final data sample (Holding Final Value) or repeat the entire signal from the beginning (Cyclic Repetition).
Supported Data Types
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| From Wave Device |
DSP Blockset |
| From Wave File |
DSP Blockset |
| Signal To Workspace |
DSP Blockset |
| Signal From Workspace |
DSP Blockset |
| Triggered To Workspace |
DSP Blockset |
See the sections below for related information:
| Triggered Delay Line | Triggered To Workspace | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |