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.
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
Port_1 — Signal or signals to visualize
scalar | vector | matrix | array
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
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.
Display traces — Number of data vectors to display
6 (default) | positive integer
Update interval — Number of vectors to store
1 (default) | positive integer
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 |
Colormap — Colors of display
autumn
(default) | gray
| hot
| pink
| jet
| copper
| red
| white
Transparency — Transparency of oldest and newest data vectors
newest: opaque, oldest: transparent (default)
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.
Axis color — Color of axes
'w'
(default) | RGB triplet | specified color name | hexadecimal color code
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 from0
toF
. 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 Name | Short Name | RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|---|---|
"red" | "r" | [1 0 0] | "#FF0000" | |
"green" | "g" | [0 1 0] | "#00FF00" | |
"blue" | "b" | [0 0 1] | "#0000FF" | |
"cyan"
| "c" | [0 1 1] | "#00FFFF" | |
"magenta" | "m" | [1 0 1] | "#FF00FF" | |
"yellow" | "y" | [1 1 0] | "#FFFF00" | |
"black" | "k" | [0 0 0] | "#000000" | |
"white" | "w" | [1 1 1] | "#FFFFFF" |
Here are the RGB triplets and hexadecimal color codes for the default colors MATLAB® uses in many types of plots.
RGB Triplet | Hexadecimal Color Code | Appearance |
---|---|---|
[0 0.4470 0.7410] | "#0072BD" | |
[0.8500 0.3250 0.0980] | "#D95319" | |
[0.9290 0.6940 0.1250] | "#EDB120" | |
[0.4940 0.1840 0.5560] | "#7E2F8E" | |
[0.4660 0.6740 0.1880] | "#77AC30" | |
[0.3010 0.7450 0.9330] | "#4DBEEE" | |
[0.6350 0.0780 0.1840] | "#A2142F" |
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'")) |
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.
History traces — Number of vectors to store
10 (default) | positive integer
When the buffer is full — Behavior of full buffer
Overwrite
(default) | Suspend
| Extend
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 |
Data logging — Export data from block
Selected
(default) | All visible
| All history
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 |
Export variable — Variable name of exported data
ExportData
(default) | valid MATLAB variable name
Export at end of simulation — Automatically export data
off
(default) | on
Triggering
These parameters control when the Waterfall block starts and stops capturing data.
Begin recording — When to start capturing data
Immediately
(default) | After T seconds
| After N inputs
| User-defined
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 |
Stop recording — When to stop capturing data
Never
(default) | After T seconds
| After N inputs
| User-defined
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 |
Re-arm trigger — When to capture data
Never
(default) | After T seconds
| After N inputs
| User-defined
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.
Transform — Transformation to apply to input
None
(default) | Amplitude-> dB
| Complex-> Mag Lin
| Complex-> Mag dB
| ...
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 |
Function — Custom transformation function
abs
(default)
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 |
Expression — Custom transformation expression
(u+1)/2 (default) | expression with real-valued output
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 |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
HDL Code Generation
Generate VHDL, Verilog and SystemVerilog code for FPGA and ASIC designs using HDL Coder™.
This block can be used for simulation visibility in subsystems that generate HDL code, but is not included in the hardware implementation.
PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
Version History
Introduced before R2006aR2020b: 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
Scope (Simulink) | Time Scope | Spectrum Analyzer
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)