Documentation

DSP.ArrayPlotSystem object

Display vectors or arrays

Description

The dsp.ArrayPlot System object™ displays vectors or arrays.

To display vectors or array on the Array Plot:

  1. 创建DSP.ArrayPlot对象并设置其属性。

  2. 用参数调用对象,就好像它是一个函数一样。

To learn more about how System objects work, seeWhat Are System Objects?(MATLAB)。

Creation

Syntax

= dsp范围。ArrayPlot
范围= dsp.ArrayPlot(Name,Value)

Description

example

= dsp范围。ArrayPlotcreates an Array Plot System object,scope

范围= dsp.ArrayPlot(Name,Value)sets properties using one or more name-value pairs. Enclose each property name in single quotes. For example,范围= dsp.ArrayPlot('NumInputPorts',3)

Properties

expand all

Unless otherwise indicated, properties arenontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the发布功能解锁它们。

如果a property istunable, you can change its value at any time.

For more information on changing property values, seeSystem Design in MATLAB Using System Objects(MATLAB)。

Plot Configuration

Number of input ports, specified as a positive integer. Each signal coming through a separate input becomes a separate channel in the scope. You must invoke the scope with the same number of inputs as the value of this property.

指定是否使用SampleIncrementXOffset属性值确定间距,或指定您自己的自定义间距。如果指定'风俗',您还必须指定CustomXDataproperty values.

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置X-data mode

指定desiredx-data values as a row or column vector of length equal to the frame length of the inputs. If you use the default (empty vector) value, thex-data均匀间隔并设置为(0:L–1), whereL是the frame length.

Example:scope = dsp.ArrayPlot('xdatamode','custom','customxdata',logspace(0,log10(44100/2),1024))

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置自定义X-DATA

依赖性

要使用此属性,请设置XDataModeto'风俗'

指定沿着样品之间的间距x- 作为有限数字标量的轴。输入信号仅为y-axis data.x- 轴数据是根据XOffsetSampleIncrementproperties. For example, whenXoffset是0 andSampleIncrement是1,x-data for the input signal is set to 0, 1, 2, 3, 4, etc. If you setSampleIncrementto 0.25, thex- 轴数据变为0、0.25、0.5、0.75、1等。

Tunable:Yes

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置样品增量

指定offset to display on thex-axis. This property is a scalar

Tunable:Yes

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置X-offset

Specify whether the scale of thex- 轴是“线性”或者'Log'。如果XOffset是负值,您不能将此属性设置为'Log'

Tunable:Yes

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置X轴等级

指定type of plot to use for all the input signals displayed in the scope window:

  • '干'- 示波器显示输入信号,因为圆形线延伸至x-axis at each of the sampled values. This option is similar to thestemfunction.

  • 'Line'- 范围将输入信号显示为连接每个采样值的线路。此选项类似于line或者plotfunctions.

  • '楼梯'– The scope displays the input signal as a stair-step graph. A stair-step graph is made up of only horizontal lines 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 a change in values occurring at a sample. This option is similar to thestairsfunction. Stair-step graphs are useful for drawing time history graphs of digitally sampled data.

UI Use

Open the风格对话框并设置Plot type

Specify when the scope scales the axes. Valid values are:

  • '汽车'- 范围在模拟过程中和之后,根据需要缩放轴以适合数据。

  • 'Manual'— The scope does not scale the axes automatically.

  • 'OnCeatStop'- 当模拟停止时,范围会缩放轴。

  • 'Updates'——尺度范围轴只一次,once after 10 updates.

UI Use

选择工具>轴缩放

Visualization

指定范围的名称。此名称显示为示波器图窗口的标题。要指定范围图的标题,请使用Titleproperty.

Data Types:char|string

Specify, in pixels, the size and location of the scope window as a four-element vector of the form[left bottom width height]。默认情况下,范围窗口出现在屏幕的中心,宽度为800pixels and height of450pixels. The default values for this property may change depending on your screen resolution.

  • 真的- 范围日志数据以供以后使用和定期更新窗口。

  • false— The scope updates every time the scope is called.

The simulation speed is faster when this property is set to真的

Tunable:Yes

UI Use

选择Simulation>Reduce Updates to Improve Performance

Specify whether to display the scope in maximized-axes mode. In this mode, the axes are expanded to fit into the entire display. To conserve space, labels do not appear in each display. Instead, tick-mark values appear on top of the plotted data. You can select one of the following options:

  • '汽车'— The axes appear maximized in all displays only if theTitleylabelproperties are empty for every display. If you enter any value in any display for either of these properties, the axes are not maximized.

  • 'On'- 在所有显示器中,轴似乎最大化。输入的任何值Titleylabel属性是隐藏的。

  • 'Off'- 轴似乎没有最大化。

Tunable:Yes

UI Use

Open theConfiguration Properties。On the主要的选项卡,设置最大化轴

将显示标题指定为字符向量或字符串。要使用输入名称作为显示标题,请输入'%'

Tunable:Yes

UI Use

Open theConfiguration Properties。On theDisplay选项卡,设置Title

To show a legend with the input names, set this property to真的

从传说中,您可以控制哪些信号可见。该控制等同于改变可见性风格dialog box. 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. To show all signals, pressEsc键

Tunable:Yes

UI Use

Open theConfiguration Properties。On theDisplay选项卡,选择Show legend

指定input channel names as a cell array of character vectors. The names appear in the legend,风格对话框,Measurementspanels. If you do not specify names, the channels are labeled asChannel 1,Channel 2, ETC。

Tunable:Yes

依赖性

To see channel names, setshowlegendto真的

UI Use

On the legend, double-click the channel name.

将此属性设置为真的to show gridlines on the plot.

Tunable:Yes

UI Use

Open theConfiguration Properties。On theDisplay选项卡,设置Show grid

当您将此属性设置为真的, the scope plots the magnitude and phase of the input signal on two separate axes within the same active display. When you set this property tofalse,范围将输入信号的真实和虚构部分绘制在同一活动显示内的两个单独轴上。

该属性可用于复杂值的输入信号。打开此属性会影响实价输入信号的阶段。当输入信号的幅度无负时,该相为0度。当输入信号的幅度为负时,该相为180度。

Tunable:Yes

UI Use

Open theConfiguration Properties。On theDisplay选项卡,选择绘图信号作为大小和相位

指定文本的范围以显示下方的范围x-axis.

Tunable:Yes

UI Use

Open theConfiguration Properties。On theDisplay选项卡,设置X-label

指定文本以显示范围在y-axis.

Tunable:Yes

Dependencies

此属性仅适用PlotAsMagnitudePhasefalse。WhenPlotAsMagnitudePhase真的, 他们俩y- 轴标签s are read-only values. They- 轴标签s are set to'Magnitude''Phase'for the magnitude plot and the phase plot, respectively.

UI Use

Open theConfiguration Properties。On theDisplay选项卡,设置Y标签

Data Types:char|string

指定y-axis limits as a two-element numeric vector,[ymin, ymax]

如果PlotAsMagnitudePhasefalse, the default is[-10,10]。如果PlotAsMagnitudePhase真的, the default is[0,10]

Tunable:Yes

Dependencies

WhenPlotAsMagnitudePhase真的, this property specifies they-axis limits of only the magnitude plot. They-axis limits of the phase plot are always[-180,180]

UI Use

Open theConfiguration Properties。On theDisplay选项卡,设置Y限度(最低)Y-limits (Maximum)

用法

For versions earlier than R2016b, use thestepfunction to run the System object™ algorithm. The arguments tostepare the object you created, followed by the arguments shown in this section.

For example,y = step(obj,x)y = obj(x)perform equivalent operations.

Syntax

范围(signal)
范围(signal1,signal2,...,signalN)

Description

example

范围(signal)displays the signal in the Array Plot.

范围(signal1,signal2,...,signalN)displays multiple signals in the Array Plot. The signals must have the same frame length, but can vary in number of channels. You must set theNumInputPorts属性以启用多个输入信号。

输入参数

expand all

Specify one or more input signals to visualize in theDSP.ArrayPlot。信号可以具有不同数量的通道,但是它们必须具有相同的帧长度。

Example:范围(signal1, signal2)

Data Types:单身的|double|int8|int16|int32|int64|uint8|uint16|uint32|Uint64|logical|char|string|struct|桌子|细胞|categorical|约会时间|fi

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object namedobj, use this syntax:

释放(OBJ)

expand all

show Display scope window
隐藏 Hide scope window
是Visible 确定范围的可见性
step 运行系统对象算法
发布 释放资源并允许更改系统对象属性值和输入特性
reset 重置系统对象的内部状态

Examples

expand all

不te: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the object with the equivalentstepsyntax. For example,myObject(x)变成step(myObject,x)

创建一个新的数组图对象。

范围= dsp.ArrayPlot;

Configure the properties of the Array Plot object for a Gaussian distribution.

scope.YLimits = [0 1]; scope.XOffset = -2.5; scope.SampleIncrement = 0.1; scope.Title ='Gaussian distribution'; scope.XLabel ='X'; scope.YLabel ='f(X)';

Call the Array Plot object to plot a Gaussian distribution.

范围(Exp( - ( -  2.5:.1:2.5)。*( -  2.5:.1:2.5))')

不te: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the object with the equivalentstepsyntax. For example,myObject(x)变成step(myObject,x)

查看阵列图图上的最小平均正方形(LMS)自适应滤波器重量。观察过滤器的重量在适应过滤噪声输入信号时会发生变化。

Create an LMS adaptive filter System object.

lmsFilter = dsp.LMSFilter(40,'方法','Normalized LMS','步长',0.002);

Create and configure a dsp.AudiFileReader System object to read the input signal from the specified audio file.

signalSource = dsp.AudioFileReader('dspafxf_8000.wav',...'SamplesPerFrame',40,...'PlayCount',Inf,...'outputDatatype','双倍的');

Create and configure a dsp.FIRFilter System object to filter random white noise, creating colored noise.

firFilter = dsp.FIRFilter('Numerator',fir1(39,0.25));

Create and configure an Array Plot System object to display the adaptive filter weights.

范围= dsp.ArrayPlot('xlabel','Filter Tap',...'ylabel',“过滤重量”,...'YLimits',[-0.05 0.2]');

Plot the LMS filter weights as they adapt to a desired signal. Read from the audio file, produce random data, and filter the random data. Update the filter weights and plot the filter weights.

numplays = 0;尽管numplays < 3 [y, eof] = signalSource(); noise = rand(40,1); noisefilt = firFilter(noise); desired = y + noisefilt; [~, ~, wts] = lmsFilter(noise,desired); scope(wts); numplays = numplays + eof;end

Tips

  • 要关闭数组绘图窗口并清除其相关数据,请使用MATLAB®clearfunction.

  • To hide or show the Array Plot window, use the隐藏showfunctions.

  • Use the MATLABMCCfunction to compile code containing an Array Plot.

Extended Capabilities

在R2013a中引入

这个话题有帮助吗?