Main Content

Waterfall

(To be removed) View vectors of data over time

The Waterfall block will be removed in a future release. Use a different scope instead, see Scopes and Data Logging.

  • Library:
  • DSP System Toolbox / Sinks

    DSP System Toolbox HDL Support / Sinks

  • Waterfall block

Description

The Waterfall block displays multiple vectors of data at one time. These vectors represent the input data at consecutive sample times.

The data is displayed in 3D in the Waterfall window. By default, the x-axis represents amplitude, the y-axis represents samples, and the z-axis represents time. You can adjust the number of sample vectors that the block displays, move and resize the Waterfall window, and modify block parameter values during the simulation. The Waterfall window has toolbar buttons that enable you to zoom in on the displayed data, suspend the data capture, freeze the scope display, save the scope position, and export data to the workspace.

The toolbar buttons are labeled on the Waterfall window as it appears when you double-click a Waterfall block.

Ports

Input

expand all

The Waterfall block accepts most numeric data types as input. However, the input is converted to double-precision before the block processes the data. The Waterfall block displays only real-valued, double-precision vectors of data.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | fixed point

Parameters

expand all

You can control the display and behavior of the Waterfall window using the Parameters dialog box. To open the Parameters dialog box, click the Scope parameters button.

You can alter the Waterfall parameters while the simulation is running. However, when you make changes to values in text boxes, you must click Enter or click outside the text box for the block to accept your changes.

Display

These parameters control the Waterfall display.

Number of data vectors to display in the Waterfall window, specified as a positive integer.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: NumTraces
Type: positive scalar specified as a character vector

Number of vectors the block should store before it displays them to the window, specified as a positive integer.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: UpdateInterval
Type: positive scalar specified as a character vector

Colors for the displayed data, specified as a valid colormap.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: CMapStr
Type: character vector
Type: valid colormap name, see map

Transparency of the oldest and newest data vectors, specified with the sliders. The leftmost position makes the data vector transparent. The rightmost position makes the data vector opaque. The intermediate data vectors transition between the two chosen transparency values.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: TNewest and TOldest
Type: number between [0,1] specified as a character vector

Axes

These parameters control the axes in the Waterfall window.

Minimum value of the y-axis specified as an integer.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: YMin
Type: character vector

Maximum value of the y-axis specified as an integer

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: YMax
Type: character vector

Color of the axes, specified as a ColorSpec (Color Specification).

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: AxisColor
Type: character vector within a character vector
Example: set_param(block,'AxisColor',char("'b'"))

Enter the x-axis label.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: XLabel
Type: character vector

Enter the y-axis label.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: YLabel
Type: character vector

Enter the z-axis label.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: ZLabel
Type: character vector

Data History

These parameters control how many input data vectors the Waterfall block stores. They also control how the data is exported to the MATLAB® workspace.

Number of vectors (traces) that you want the block to store, specified as a positive integer.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: HistoryLength
Type: positive integer specified as a character vector

Use this parameter to control the behavior of the block when the buffer is full:

  • Overwrite — The old data is replaced with the new data.

  • Suspend — The block stops storing data in the buffer; but the simulation continues to run.

  • Extend — The block extends the buffer so that it can continue to store all the input data.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: HistoryFull
Type: character vector

Use this parameter to control which data is exported from the block:

  • Selected — The selected data vector is exported.

  • All visible — All of the data vectors displayed in the Waterfall window are exported.

  • All history — All of the data vectors stored in the history buffer of the block are exported.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: ExportMode
Type: character vector

Name of the variable that represents your data in the MATLAB workspace.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: MLExportName
Type: character vector

Select this check box to automatically export the data to the MATLAB workspace when the simulation stops.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: AutoExport
Values: 'off' | 'on'

Triggering

These parameters control when the Waterfall block starts and stops capturing data.

This parameter controls when the Waterfall block starts capturing data:

  • Immediately — The Waterfall window captures the input data as soon as the simulation starts.

  • After T seconds — The Time, T parameter appears in the dialog box. Enter the number of seconds the block should wait before it begins capturing data.

  • After N inputs — The Count, N parameter appears in the dialog box. Enter the number of inputs the block should receive before it begins capturing data.

  • User-defined — The Function name parameter appears in the dialog box. Enter the name of a MATLAB function that defines when the block should begin capturing data. For more information about how you define this function, see Scope Trigger Function.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: TrigStartMode | TrigStartT | TrigStartN | TrigStartFcn
Type: character vector

This parameter controls when the Waterfall block stops capturing data:

  • Never — The block captures the input data as long as the simulation is running.

  • After T seconds — The Time, T parameter appears in the dialog box. Enter the number of seconds the block should wait before it stops capturing data.

  • After N inputs —The Count, N parameter appears in the dialog box. Enter the number of inputs the block should receive before it stops capturing data.

  • User-defined — The Function name parameter appears in the dialog box. Enter the name of a MATLAB function that defines when the block should stop capturing data. For more information about how you define this function, see Scope Trigger Function.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: TrigStopMode | TrigStopT | TrigStopN | TrigStopFcn
Type: character vector

This parameter controls when the Waterfall block begins waiting to capture data.

  • Never — The Waterfall Scope block starts and stops capturing data as defined by the Begin recording and Stop recording parameters.

  • After T seconds — The Time, T parameter appears in the dialog box. Enter the number of seconds the block should wait before it begins waiting to capture data.

  • After N inputs — The Count, N parameter appears in the dialog box. Enter the number of inputs the block should receive before it begins waiting to capture data.

  • User-defined — The Function name parameter appears in the dialog box. Enter the name of a MATLAB function that defines when the block should begin waiting to capture data. For more information about how you define this function, see Scope Trigger Function.

Dependency

To enable this parameter, set Stop recording to After T seconds, After N inputs, or User-defined.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: TrigRearmMode | TrigRearmT | TrigRearmN | TrigRearmFcn
Type: character vector

Transform

These parameters transform the input data to the Waterfall block. The result of the transform is displayed in the Waterfall window.

The block assumes that the input to the block corresponds to the Transform parameter you select. For example, when you choose Complex-> Angle, the block assumes that the input is complex. But the block does not produce an error when the input is not complex. Therefore, you must verify the format of your input data to guarantee that a meaningful result is displayed in the Waterfall window.

Choose a transform that you would like to apply to the input of the Waterfall block:

  • None — The input is displayed as it is received by the block.

  • Amplitude-> dB — The block converts the input amplitude into decibels.

  • Complex-> Mag Lin — The block converts the complex input into linear magnitude.

  • Complex-> Mag dB — The block converts the complex input into magnitude in decibels.

  • Complex-> Angle — The block converts the complex input into phase.

  • FFT-> Mag Lin Fs/2 — The block takes the linear magnitude of the FFT input and plots it from 0 to the Nyquist frequency.

  • FFT-> Mag dB Fs/2 — The block takes the magnitude of the FFT input, converts it to decibels, and plots it from 0 to the Nyquist frequency.

  • FFT-> Angle Fs/2 — The block converts the FFT input into phase and plots it from 0 to the Nyquist frequency.

  • Power-> dB — The block converts the input power into decibels.

  • User-defined fcn — see Function.

  • User-defined expr — see Expression.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: XFormMode
Type: character vector

Enter a function that you would like to apply to the input of the Waterfall block. For more information about how you define this function, see Scope Transform Function.

Dependency

To enable this parameter, set Transform to User-defined fcn.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: XFormFcn
Type: character vector

Enter an expression that you would like to apply to the input of the Waterfall block. The result of this expression must be real-valued. When you write the expression, be sure to include only one unknown variable. The block assumes this unknown variable represents the input to the block. When the block believes your expression is invalid, this window appears.

When you click No, your expression is not applied to the input. When you click Yes and your expression is invalid, your simulation stops and Simulink® displays an error.

Dependency

To enable this parameter, set Transform to User-defined expr.

Programmatic Use

Control this parameter from the command-line using set_param (Simulink) and get_param (Simulink).

Block Parameter: XFormExpr
Type: character vector

Block Characteristics

Data Types

double | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Compatibility Considerations

expand all

Not recommended starting in R2020b

Extended Capabilities

See Also

| | (Simulink)

Introduced before R2006a