Triggered To Workspace - Write input sample to MATLAB workspace when triggered - Simulink (original) (raw)

Main Content

Write input sample to MATLAB workspace when triggered

Libraries:
DSP System Toolbox / Sinks

Description

The Triggered To Workspace block creates a matrix or array variable in the MATLAB® workspace, where it stores the acquired inputs at the end of a simulation. The block overwrites an existing variable with the same name.

To save a record of the sample time corresponding to each sample value, open the Configuration Parameters dialog box. To open the Configuration Parameters, in theModeling tab of the Simulink® model toolstrip, click Model Settings. In the left pane of the window that opens, click Data Import/Export and select the Time check box.

The nontriggered version of this block is the To Workspace (Simulink) block.

Ports

Input

expand all

Specify the data to log to the workspace when the block receives a trigger at theTrigger port. The Triggered To Workspace block supports logging real and complex data of any built-in data type or user-defined data types such as buses, enumerations, and fixed-point data.

Tips

Logging fixed-point data requires a Fixed-Point Designer™ license.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | string | fixed point | enumerated | bus | image
Complex Number Support: Yes

Specify the trigger signal that controls the execution of the block as a scalar, vector, or a matrix.

Data Types: single | double | half | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point

Parameters

expand all

The type of event that triggers the execution of the block.

The block acquires and buffers a single frame from input 1 whenever it is triggered by the control signal at input 2 (). At all other times, the block ignores input 1. You specify the triggering event at input 2 using the parameter:

The name of the workspace variable in which to store the data. By default, theTriggered To Workspace block saves logged data in a variable called yout. When a model contains multipleTriggered To Workspace blocks, you must specify a unique value in the Variable name parameter of each block.

Specify a decimation factor to reduce the effective sample rate for the logged data. For a decimation factor D the Triggered To Workspace block logs the value of every_D_th sample. For example, when you specify the Decimation value as2, the Triggered To Workspace block logs every other data point.

For more information about controlling which samples the block logs during simulation, see Specify Signal Values to Log (Simulink).

Specify the maximum number of rows (one row per time step) that the block saves (P) as a positive integer.

Specify whether the block saves 2-D signals as a 2-D or 3-D array in the MATLAB workspace.

When you select:

Specify how to log fixed-point input data. By default, theTriggered To Workspace block logs fixed-point input data as double. When you select this parameter, theTriggered To Workspace block logs fixed-point input as a Fixed-Point Designerfi (Fixed-Point Designer) object.

Using the Triggered To Workspace block to log fixed-point data requires a license for Fixed-Point Designer.

Block Characteristics

Data Types Boolean | double enumerated fixed point integer single
Direct Feedthrough no
Multidimensional Signals no
Variable-Size Signals no
Zero-Crossing Detection no

Extended Capabilities

expand all

This block can be used for simulation visibility in subsystems that generate HDL code, but is not included in the hardware implementation.

Version History

Introduced before R2006a