Configure Array Plot - MATLAB & Simulink (original) (raw)

When you use the dsp.ArrayPlot object in MATLAB® or the Array Plot block in Simulink® you can configure many settings and tools from the interface. These sections show you how to use the Array Plot interface and the tools available.

Signal Display

This figure highlights the important aspects of the Array Plot window, in MATLAB:

And in Simulink:

Multiple Signal Names and Colors

By default, if the input signal has multiple channels, the scope uses an index number to identify each channel of that signal. For example, the legend for a two-channel signal will display the default names Channel 1,Channel 2. To show the legend, on theScope tab, click Legend. If there are a total of seven input channels, the legend displayed is:

When the background is black, the default colors of the input channels are yellow, blue, orange, green, purple, teal, and pink.

By default, the scope has a black axes background and chooses line colors for each channel in a manner similar to the Scope (Simulink) block. When the scope axes background is black, it assigns each channel of each input signal a line color in the order shown in the legend. If there are more than seven channels, then the scope repeats this order to assign line colors to the remaining channels. When the axes background is not black, the signals are colored in this order:

When the background is not black, the default colors of the input channels are dark blue, orange, dark yellow, purple, green, light blue, and maroon.

To choose line colors or background colors, on the Scope tab, click Settings. Use the Axes color drop-down to change the background of the plot. Click Line to choose a line to change, and the Color drop-down to change the line color of the selected line.

Configure Scope Settings

On the Scope tab, the Configuration section allows you to modify the plot.

Use Array Plot Measurements

All measurements are made for a specified channel. By default, measurements are applied to the first channel. To change which channel is being measured, use theSelect Channel drop-down in theMeasurements tab.

Data Cursors

Use the Data Cursors button to display screen cursors. The cursors are vertical cursors that track along the selected signal. Between the two cursors, the difference between the _x_- and_y_-values of the signal at the two cursor points is displayed.

Signal Statistics

Use the Signal Statistics button to display statistics about the selected signal at the bottom of the array plot window. You can hide or show the Statistics panel using the arrow button in the bottom right of the panel.

To customize which statistics to show and compute, use theSignal Statistics list.

Peak Finder

Use the Peak Finder button to display peak values for the selected signal. Peaks are defined as a local maximum where lower values are present on both sides of a peak. Endpoints are not considered peaks. For more information on the algorithms used, see findpeaks.

When you turn on the peak finder measurements, an arrow appears on the plot at each maxima and a Peaks panel appears at the bottom of the array plot window showing the x and y values at each peak.

You can customize several peak finder settings:

Share or Save the Array Plot

If you want to save the array plot for future use or share it with others, use the buttons in the Share section of the Scope tab.

Scale Axes

To scale the plot axes, you can use the mouse to pan around the axes and the scroll button on your mouse to zoom in and out of the plot. Additionally, you can use the buttons that appear when you hover over the plot window.

Set Additional Properties

You can only change some Array Plot properties outside the Array Plot window, such as the signal names in the legend or the number of inputs. For thedsp.ArrayPlot object, you can set those properties from the command-line. For the Array Plot block, set those properties using the Property Inspector (Set Block Parameter Values (Simulink)) or from the command-line using get_param (Simulink) and set_param (Simulink).

Find the Array Plot Block in Your Model

To highlight the Array Plot block within your model, on theScope tab, select the Highlight Block button. On the Simulink canvas, the Array Plot block is outlined in a highlight color so you can more easily identify it in your model.

See Also

dsp.ArrayPlot | Array Plot

Topics