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.

  • Waterfall block

Libraries:
DSP System Toolbox / Obsolete Blocks

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 RGB triplet, specified color name, or hexadecimal color code.

RGB triplets and hexadecimal color codes are useful for specifying custom colors.

  • An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7].

  • A hexadecimal color code is a character vector or a string scalar that starts with a hash symbol (#) followed by three or six hexadecimal digits, which can range from 0 to F. The values are not case sensitive. Thus, the color codes "#FF8800", "#ff8800", "#F80", and "#f80" are equivalent.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and hexadecimal color codes.

Color NameShort NameRGB TripletHexadecimal Color CodeAppearance
"red""r"[1 0 0]"#FF0000"

Sample of the color red

"green""g"[0 1 0]"#00FF00"

Sample of the color green

"blue""b"[0 0 1]"#0000FF"

Sample of the color blue

"cyan" "c"[0 1 1]"#00FFFF"

Sample of the color cyan

"magenta""m"[1 0 1]"#FF00FF"

Sample of the color magenta

"yellow""y"[1 1 0]"#FFFF00"

Sample of the color yellow

"black""k"[0 0 0]"#000000"

Sample of the color black

"white""w"[1 1 1]"#FFFFFF"

Sample of the color white

Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.

RGB TripletHexadecimal Color CodeAppearance
[0 0.4470 0.7410]"#0072BD"

Sample of RGB triplet [0 0.4470 0.7410], which appears as dark blue

[0.8500 0.3250 0.0980]"#D95319"

Sample of RGB triplet [0.8500 0.3250 0.0980], which appears as dark orange

[0.9290 0.6940 0.1250]"#EDB120"

Sample of RGB triplet [0.9290 0.6940 0.1250], which appears as dark yellow

[0.4940 0.1840 0.5560]"#7E2F8E"

Sample of RGB triplet [0.4940 0.1840 0.5560], which appears as dark purple

[0.4660 0.6740 0.1880]"#77AC30"

Sample of RGB triplet [0.4660 0.6740 0.1880], which appears as medium green

[0.3010 0.7450 0.9330]"#4DBEEE"

Sample of RGB triplet [0.3010 0.7450 0.9330], which appears as light blue

[0.6350 0.0780 0.1840]"#A2142F"

Sample of RGB triplet [0.6350 0.0780 0.1840], which appears as dark red

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

Extended Capabilities

Version History

Introduced before R2006a

collapse all

R2020b: Waterfall block will be removed

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

See Also

(Simulink) | |