Display vectors or arrays
DSP System Toolbox / Sinks
The Array Plot block plots vectors or arrays of data.
The Array Plot is a vector plot where data is uniformly spaced along
the x-axis. To modify the spacing, change the Sample
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 the x-axis values at which they occur.
Port_1
— Signal or signals to visualizeConnect 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
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| Boolean
| fixed point
| enumerated
Complex Number Support: Yes
These properties are available from the Property Inspector, see Set Block Parameter Values (Simulink) for more details. For information about using the Array Plot toolstrip, see Configure Array Plot.
Number of input ports
— Number of input portsThe 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.
Right-click the block and select Signals & Ports > Number of Input Ports.
Block Parameter:
NumInputPorts |
Type: character vector or string scalar |
Values: scalar between 1 and 96 |
Open at start of simulation
— Automatically open scope at startSelect this parameter to automatically open the Array Plot window when you run the simulation.
Block Parameter:
OpenAtSimulationStart |
Type: logical |
X-Data Mode
— Type of x-axis spacingSample increment and X-offset
(default) | Custom
Select the type of spacing to use between x-axis data values.
Sample increment and X-offset
— Use the
Sample Increment and X-Offset values to specify x-axis data.
Custom
— Specify a custom spacing between
data values using the Custom X-data property.
On the Plot tab, select Settings.
In Settings, set X-Data Mode.
Block Parameter:
XDataMode |
Type: character vector or string scalar |
Values:
'Sample increment and X-offset' |
'Custom' |
Sample Increment
— x-axis spacing1
(default) | finite scalarSpecify the spacing between samples along the x-axis as a finite numeric scalar. The input signal is only y-axis data. x-axis data is set automatically based on both the Sample Increment and X-Offset values.
Example: When X-Offset is 0 and Sample Increment is 1, the x-axis values are set to 0, 1, 2, 3, 4, … .
Example: When X-Offset is -1 and Sample Increment is 0.25, the x-axis values are set to -1, -0.75, -0.5, -0.25, 0, … .
Tunable: Yes
To use this property, set X-Data Mode to
Sample increment and X-offset
.
On the Plot tab, select Settings.
In Settings, set X-Data Mode to Increment and Offset and set the Sample Increment setting.
Block Parameter:
SampleIncrement |
Type: character vector or string scalar |
Values: scalar |
See SampleIncrement
.
X-Offset
— x-axis offset0
(default) | scalarSpecify the offset to apply to the x-axis, as a numeric scalar. x-axis data is set automatically based on both the Sample Increment and X-Offset values. The x-offset represents the first value on the x-axis.
Example: When X-Offset is 0 and Sample Increment is 1, the x-axis values are set to 0, 1, 2, 3, 4, … .
Example: When X-Offset is -1 and Sample Increment is 0.25, the x-axis values are set to -1, -0.75, -0.5, -0.25, 0, … .
Tunable: Yes
To use this property, set X-Data Mode to
Sample increment and X-offset
.
On the Plot tab, select Settings.
In Settings, set X-Data Mode to Increment and Offset and set the Sample Increment setting.
Block Parameter:
XOffset |
Type: character vector or string scalar |
Values: scalar |
Custom X-data
— x-axis data valuesSpecify the x-axis data values as a vector equal in length to the frame length of the inputs. If you use the default (empty vector) value, the x-axis data is uniformly spaced over the interval (0:L-1), where L is the frame length.
Example: A custom logarithmic x-axis data scaling is
[0:log10(44100/2):1024]
Tunable: Yes
To use this property, set X-Data Mode to
Custom
On the Plot tab, select Settings.
In Settings, set X-Data Mode to Custom.
Enter a Custom X-Data value and
select apply .
Block Parameter:
CustomXData |
Type: character vector or string scalar |
Values: scalar |
Default:
'[]' |
X-Axis Scale
— x-axis scaleLinear
(default) | Log
Select Linear
or Log
as the
x-axis scale.
Tunable: Yes
If X-Offset is a negative value, you cannot set
this parameter to Log
.
On the Plot tab, select Settings.
In Settings, set XScale.
Block Parameter:
XScale |
Type: character vector or string scalar |
Y-Axis Scale
— y-axis scaleLinear
(default) | Log
Select Linear
or Log
as the
y-axis scale.
Tunable: Yes
On the Plot tab, select Settings.
In Settings, set YScale.
Block Parameter:
YScale |
Type: character vector or string scalar |
Plot Type
— Type of plotStem
(default) | Stairs
| Line
Stem
— Stem graph displayed as circles at the
input value with vertical lines to the
x-axis.
Line
— Line graph
Stairs
— 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
On the Plot tab, select Settings.
In Settings, set Plot Type.
Block Parameter:
PlotType |
Type: character vector or string scalar |
Axes scaling
— Y-axis scaling modeOnceAtStop
(default) | Manual
| Auto
| AfterNUpdates
OnceAtStop
— Scale y-axis
after the simulation is finished.
Manual
— Manually scale
y-axis range with the Scale Y-axis
Limits toolbar button.
Auto
— Scale y-axis range
during and after simulation.
AfterNUpdates
— Scale y-axis
after the number of time steps specified in the Number of updates
text box (100
by default). Scaling occurs only
once during each run.
Tunable: Yes
Hover over the array plot to see the zoom , pan
, and autoscale
buttons. You can also zoom and pan using your mouse.
Block Parameter:
AxesScaling |
Type: character vector or string scalar |
Number of updates
— Number of updates before scaling10
(default) | integerSet this property to delay auto scaling the y-axis.
Tunable: Yes
To enable this property, set Axes scaling to
AfterNUpdates
.
Block Parameter:
AxesScalingNumUpdates |
Type: character vector or string scalar |
Values: scalar |
Maximize axes
— Maximize size of plotsAuto
(default) | Off
| On
Tunable: Yes
Hover over the array plot to see the maximize axes button
.
Block Parameter:
MaximizeAxes |
Type: character vector or string scalar |
Plot as Magnitude and Phase
— Split display into magnitude and phase plotsOn — 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 same y-axis.
Tunable: Yes
On the Plot tab, select the Magnitude Phase button.
Block Parameter:
PlotAsMagnitudePhase |
Type: logical |
Title
— Display nameSpecify a title for display. To use the input signal name for the title,
enter %<SignalLabel>
.
Tunable: Yes
Open the Plot tab, click Settings, and set Title.
Block Parameter:
Title |
Type: character vector or string scalar |
Default:
'' |
X-label
— x-axis labelSpecify the text for the scope to display below the x-axis.
Tunable: Yes
Open the Plot tab, click Settings, and set XLabel.
Block Parameter:
XLabel |
Type: character vector or string scalar |
Default:
'' |
Y-label
— Y-axis labelSpecify the text to display on the y-axis. To display
signal units, add (%<SignalUnits>)
to the label. At
the beginning of a simulation, Simulink® replaces (%<SignalUnits>)
with the units
associated with the signals.
Example: For a velocity signal with units of m/s
, enter
Velocity (%<SignalUnits>)
.
Tunable: Yes
Open the Plot tab, click Settings, and set YLabel.
If you select Plot as Magnitude and Phase, this
property does not apply. The y-axes are labeled
Magnitude
and Phase
.
Block Parameter:
YLabel |
Type: character vector or string scalar |
Default:
'' |
Y-limits
— y-axis limits[-10,10]
(default) | [ymin, ymax]
Specify the y-axis limits as a two-element numeric
vector, [ymin, ymax]
.
If Plot as Magnitude and Phase is off, the default is
[-10,10]
. If the magnitude/phase plot is on, the
default is [0,10]
.
Tunable: Yes
When PlotAsMagnitudePhase
is
true
, this property specifies the
y-axis limits of only the magnitude plot. The
y-axis limits of the phase plot are always
[-180,180]
.
Open the Plot tab, click Settings, and set Y-Axis Limits as a two-element numeric vector.
Block Parameter:
YLimits |
Type: character vector or string scalar |
Value: two-element numeric vector |
Show Grid
— Show internal grid linesSelect this option to show grid lines on the plot.
Tunable: Yes
Open the Plot tab, click Settings, and select Grid.
Block Parameter:
ShowGrid |
Type: logical |
Show legend
— Display signal legendSelect this option to show the legend on the plot. The names listed in the
legend are taken from the Channel
Names
property.
From the legend, you can control which signals are visible. This control is equivalent to changing the visibility in the Style properties. 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, press Esc.
Note
The legend only shows the first 20 signals. Any additional signals cannot be controlled from the legend.
Tunable: Yes
On the Plot tab, click Legend.
Block Parameter:
ShowLegend |
Type: logical |
Channel Names
— Input 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, and
Measurements panels. If you do not specify names,
the channels are labeled as Channel 1
, Channel
2
, etc
Example: ["A","B"]
To see channel names, set Show legend to
true
.
Block Parameter:
ChannelNames |
Type: cell array of character vectors or string array |
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
This block accepts fixed-point input, but converts it to double
for display.
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
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: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.