Main Content

Triggered To Workspace

Write input sample toMATLABworkspace when triggered

Library

Sinks

dspsnks4

  • Triggered To Workspace block

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.

When you set theSave 2-D signals asparameter to2-D array (concatenate along first dimension, the block saves anM-by-Ninput as aP-by-Nmatrix, wherePis theMaximum number of rowsparameter. When the simulation progresses long enough for the block to acquire more thanPsamples, the block stores only the most recentPsamples. TheDecimation factor,D, allows you to store only everyDth input matrix.

When you set theSave 2-D signals asparameter to3-D array (concatenate along third dimension, the block saves anM-by-Ninput as a three-dimensional array in which eachM-by-N从每个页面代表一个样本M*Nchannels (the most recent input matrix occupies the last page). The maximum size of this variable is limited toM-by-N-by-P, wherePis theMaximum number of rowsparameter. When the simulation progresses long enough for the block to acquire more thanPinputs, it stores only the lastPinputs. TheDecimation factor,D, allows you to store only everyDth input matrix.

The block acquires and buffers a single frame from input 1 whenever it istriggered by thecontrol signal at input 2 (). At all other times, the block ignores input 1. You specify the triggeringevent at input 2 in theTrigger typepop-up menu:

  • Rising edgetriggers 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 edgetriggers 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 edgetriggers execution of the block when either a rising or falling edge (as described above) occurs.

To save a record of the sample time corresponding to each sample value, open the Configuration Parameters dialog box. In theSelectpane, clickData Import/Exportand select theTimecheck box.

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

Parameters

Trigger type

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

Variable name

The name of the workspace variable in which to store the data.

Maximum number of rows

The maximum number of rows (one row per time step) to be saved,P.

Decimation

The decimation factor,D.

Save 2-D signals as

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

  • 2-D array (concatenate along first dimension)— When you select this option, the block vertically concatenates eachM-by-Nmatrix input with the previous input to produce a 2-D output array.

  • 3-D array (concatenate along third dimension)— When you select this option, the block saves anM-by-Ninput signal as a 3-D array. The maximum size of this 3-D array is limited toM-by-N-by-P, wherePis theMaximum number of rowsparameter. When the simulation progresses long enough for the block to acquire more thanPinputs, the block stores only the lastPinputs. TheDecimation factor,D, allows you to store only everyDth input matrix.

Log fixed-point data as a fi object

Select to log fixed-point data to the MATLAB workspace as a Fixed-Point Designer™fiobject. Otherwise, fixed-point data is logged to the workspace asdouble.

Supported Data Types

Port Supported Data Types

Input

Trigger

  • Any data type supported by theTrigger(Simulink)block

See Also

Signal From Workspace DSP System Toolbox
To Workspace(Simulink) 万博1manbetx
Triggered Signal From Workspace DSP System Toolbox

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a