Array Plot
Display vectors or arrays
- Library:
DSP System Toolbox / Sinks
Description
TheArray Plotblock plots vectors or arrays of data.
TheArray Plotis a vector plot where data is uniformly spaced along thex-axis. To modify the spacing, change theSample Increment
property.
Measurements available:
Data Cursors — Measure signal values using vertical and horizontal cursors.
Signal Statistics — Display the maximum, minimum, peak-to-peak difference, mean, median, and RMS values of a selected signal.
Peak Finder — Find maxima, showing thex-axis values at which they occur.
港口
Input
Port_1
— Signal or signals to visualize
scalar | vector | matrix | array
Connect the signals you want to visualize. You can have up to 96 input ports. Input signals must have these characteristics:
Fixed number of channels, but size can be variable
Discrete, continuous, or constant sample time
Real or complex values
Floating- or fixed-point data type
2-D and nonscalar
TheArray Plotblock supports inputs with different frame lengths.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
|Boolean
|fixed point
Complex Number Support:Yes
Properties
For information about how to configure the Array Plot and use the toolstrip, seeConfigure Array Plot.
Plot
Legend
— Display signal legend
off (default) | on
Select this option to show the legend on the plot. The names listed in the legend are taken from theChannel Names
property.
From the legend, you can control which signals are visible. This control is equivalent to changing the visibility in theStyleproperties. In the scope legend, click a signal name to hide the signal in the scope. To show the signal, click the signal name again. To show only one signal, right-click the signal name, which hides all other signals. To show all signals, pressEsc.
Note
The legend only shows the first 20 signals. Any additional signals cannot be controlled from the legend.
Tunable:Yes
Programmatic Use
Block Parameter:ShowLegend |
Type:logical |
Magnitude and Phase
— Split display into magnitude and phase plots
off (default) | on
On — Display magnitude and phase plots. If the signal is real, the scope plots the absolute value of the signal for the magnitude. The phase is 0 degrees for positive values and 180 degrees for negative values. This feature is useful for complex-valued input signals. If the input is a real-valued signal, selecting this check box returns the absolute value of the signal for the magnitude.
Off — Display signal plot. If the signal is complex, the scope plots the real and imaginary parts on the samey-axis.
Tunable:Yes
Programmatic Use
Block Parameter:PlotAsMagnitudePhase |
Type:logical |
Measurements
For more information about the measurements, seeUse Array Plot Measurements.
Settings
Data and AxesX-Data Mode
— Type ofx-axis spacing
Sample increment and X-offset(default) |自定义
Select the type of spacing to use betweenx-axis data values.
Sample increment and X-offset— Use theSample IncrementandX-Offsetvalues to specifyx-axis data.
自定义— Specify a custom spacing between data values using the自定义X-dataproperty.
Programmatic Use
Block Parameter:XDataMode |
Type:character vector or string scalar |
Values:'Sample increment and X-offset' |'Custom' |
Sample Increment
—x-axis spacing
1
(default) | finite scalar
Specify the spacing between samples along thex-axis as a finite numeric scalar. The input signal is onlyy-axis data.x-axis data is set automatically based on both theSample IncrementandX-Offset值。
例子:WhenX-Offsetis 0 andSample Incrementis 1, thex-axis values are set to 0, 1, 2, 3, 4, … .
例子:WhenX-Offsetis -1 andSample Incrementis 0.25, thex-axis values are set to -1, -0.75, -0.5, -0.25, 0, … .
Tunable:Yes
Dependency
To use this property, setX-Data ModetoSample increment and X-offset
.
Programmatic Use
Block Parameter:SampleIncrement |
Type:character vector or string scalar |
Values:scalar |
X-Offset
—x-axis offset
0
(default) | scalar
Specify the offset to apply to thex-axis, as a numeric scalar.x-axis data is set automatically based on both theSample IncrementandX-Offset值。x代表第一个值thex-axis.
例子:WhenX-Offsetis 0 andSample Incrementis 1, thex-axis values are set to 0, 1, 2, 3, 4, … .
例子:WhenX-Offsetis -1 andSample Incrementis 0.25, thex-axis values are set to -1, -0.75, -0.5, -0.25, 0, … .
Tunable:Yes
Dependency
To use this property, setX-Data ModetoSample increment and X-offset
.
Programmatic Use
Block Parameter:XOffset |
Type:character vector or string scalar |
Values:scalar |
自定义X-data
—x-axis data values
empty vector (default) | vector with length equal to the input frame length
Specify thex-axis data values as a vector equal in length to the frame length of the inputs. If you use the default (empty vector) value, thex-axis data is uniformly spaced over the interval (0:L-1), whereLis the frame length.
例子:A custom logarithmicx-axis data scaling is[0:log10(44100/2):1024]
Tunable:Yes
Dependency
To use this property, setX-Data Modeto自定义
Programmatic Use
Block Parameter:自定义XData |
Type:character vector or string scalar |
Values:scalar |
Default:“[]” |
X-Axis Scale
—x-axis scale
Linear
(default) |Log
SelectLinear
orLog
as thex-axis scale.
Tunable:Yes
Dependency
IfX-Offsetis a negative value, you cannot set this parameter toLog
.
Programmatic Use
Block Parameter:XScale |
Type:character vector or string scalar |
Y-Axis Scale
—y-axis scale
Linear
(default) |Log
SelectLinear
orLog
as they-axis scale.
Tunable:Yes
Programmatic Use
Block Parameter:YScale |
Type:character vector or string scalar |
Y-limits
—y-axis limits
[-10,10]
(default) |[ymin, ymax]
Specify they-axis limits as a two-element numeric vector,[ymin, ymax]
.
IfMagnitude and Phaseis off, the default is[-10,10]
. If the magnitude/phase plot is on, the default is[0,10]
.
Tunable:Yes
Dependencies
WhenPlotAsMagnitudePhase
istrue
, this property specifies they-axis limits of only the magnitude plot. They-axis limits of the phase plot are always[-180,180]
.
Programmatic Use
Block Parameter:YLimits |
Type:character vector or string scalar |
Value:two-element numeric vector |
Plot Type
— Type of plot
Stem
(default) |Stairs
|Line
Stem
— Stem graph displayed as circles at the input value with vertical lines to thex-axis.Line
— Line graphStairs
— Stair-step graph. A stair-step graph is made up of only horizontal and vertical lines. Each horizontal line represents the signal value for a discrete sample period and is connected to two vertical lines. Each vertical line represents the change in the signal value occurring at a specific sample time.
Tunable:Yes
Programmatic Use
Block Parameter:PlotType |
Type:character vector or string scalar |
Grid
— Show internal grid lines
on (default) | off
Select this option to show grid lines on the plot.
Tunable:Yes
Programmatic Use
Block Parameter:ShowGrid |
Type:logical |
Title
— Display name
none (default) | string
Specify a title for display. To use the input signal name for the title, enter%
.
Tunable:Yes
Programmatic Use
Block Parameter:Title |
Type:character vector or string scalar |
Default:'' |
X-Label
—x-axis label
none (default) | string
Specify the text for the scope to display below thex-axis.
Tunable:Yes
Programmatic Use
Block Parameter:XLabel |
Type:character vector or string scalar |
Default:'' |
Y-Label
— Y-axis label
none (default) | string
Specify the text to display on they-axis. To display signal units, add(%
to the label. At the beginning of a simulation, Simulink®replaces(%
with the units associated with the signals.
例子:For a velocity signal with units ofm/s
, enterVelocity (%
.
Tunable:Yes
Dependency
If you click onMagnitude and Phase, this property does not apply. They-axes are labeledMagnitude
andPhase
.
Programmatic Use
Block Parameter:YLabel |
Type:character vector or string scalar |
Default:'' |
Property Inspector Only
Number of input ports
— Number of input ports
1 (default) | integer between 1 and 96
The number of input ports to the block, specified as an integer between 1 and 96. To change the number of input ports, drag a new input signal line to the block and the block will auto-create new ports.
Programmatic Use
Block Parameter:NumInputPorts |
Type:character vector or string scalar |
Values:scalar between 1 and 96 |
Open at start of simulation
— Automatically open scope at start
on (default) | off
Select this parameter to automatically open the Array Plot window when you run the simulation.
This parameter is only available from the Property Inspector.
Programmatic Use
Block Parameter:OpenAtSimulationStart |
Type:logical |
Channel Names
——输入channel names
[]
(default) | character vector | string | array of strings or character vectors.
Input channel names, specified as a character vector, string, or array of either. The names appear in the legend,Settings, andMeasurementspanels. If you do not specify names, the channels are labeled asChannel 1
,Channel 2
, etc.
例子:(“A”、“B”)
Dependency
To see channel names, setLegendtotrue
.
Programmatic Use
Block Parameter:ChannelNames |
Type:cell array of character vectors or string array |
Maximize axes
— Maximize size of plots
Auto
(default) |Off
|On
Hover over the array plot to see the maximize axes button.
Tunable:Yes
Programmatic Use
Block Parameter:MaximizeAxes |
Type:character vector or string scalar |
Axes scaling
— Y-axis scaling mode
OnceAtStop
(default) |Manual
|Auto
|Updates
OnceAtStop
— Scaley-axis after the simulation is finished.Manual
— Manually scaley-axis range with theScale Y-axis Limitstoolbar button.Auto
— Scaley-axis range during and after simulation.Updates
— Scaley-axis after the number of time steps specified in theNumber of updatestext box (100
by default). Scaling occurs only once during each run.
Tunable:Yes
Programmatic Use
Block Parameter:AxesScaling |
Type:character vector or string scalar |
Number of updates
— Number of updates before scaling
10
(default) | integer
Set this property to delay auto scaling the y-axis.
Tunable:Yes
Dependency
To enable this property, setAxes scalingtoAfterNUpdates
.
Programmatic Use
Block Parameter:AxesScalingNumUpdates |
Type:character vector or string scalar |
Values:scalar |
Model Examples
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.
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.
Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.
This block accepts fixed-point input, but converts it todouble
for display.
Version History
See Also
Blocks
Objects
Topics
- Configure Array Plot
- Array Plot with Apple iOS Devices(Simulink Support Package for Apple iOS Devices)
- Array Plot with Android Devices
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
欧洲
- Belgium(English)
- Denmark(English)
- Deutschland(德语)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(德语)
- Portugal(English)
- Sweden(English)
- Switzerland
- 联合王国(English)