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:
创建DSP.ArrayPlot对象并设置其属性。
用参数调用对象,就好像它是一个函数一样。
To learn more about how System objects work, seeWhat Are System Objects?(MATLAB)。
Creation
Syntax
= dsp范围。ArrayPlot
范围= dsp.ArrayPlot(Name,Value)
Description
= dsp范围。ArrayPlot
creates 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
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
NumInputPorts
—Number of input ports
1
(default) |integer between [1, 96]
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.
XDataMode
—Source of thex-data spacing
'Sample increment and X-offset'
(default) |'风俗'
指定是否使用SampleIncrement和XOffset属性值确定间距,或指定您自己的自定义间距。如果指定'风俗'
,您还必须指定CustomXDataproperty values.
UI Use
Open theConfiguration Properties。On the主要的选项卡,设置X-data mode。
CustomXData
—X-data values
空矢量(default) |向量
指定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'风俗'
。
SampleIncrement
—样品增量of input
1
(default) |finite numeric scalar
指定沿着样品之间的间距x- 作为有限数字标量的轴。输入信号仅为y-axis data.x- 轴数据是根据XOffset和SampleIncrement
properties. For example, whenXoffset
是0 andSampleIncrement
是1,x-data for the input signal is set to 0, 1, 2, 3, 4, etc. If you setSampleIncrement
to 0.25, thex- 轴数据变为0、0.25、0.5、0.75、1等。
Tunable:Yes
UI Use
Open theConfiguration Properties。On the主要的选项卡,设置样品增量。
XOffset
—Display offset of x-axis
0
(default) |标量
指定offset to display on thex-axis. This property is a scalar
Tunable:Yes
UI Use
Open theConfiguration Properties。On the主要的选项卡,设置X-offset。
XScale
—Scale of x-axis
“线性”
(default) |'Log'
Specify whether the scale of thex- 轴是“线性”
或者'Log'
。如果XOffset是负值,您不能将此属性设置为'Log'
。
Tunable:Yes
UI Use
Open theConfiguration Properties。On the主要的选项卡,设置X轴等级。
PlotType
—控制类型
'干'
(default) |'Line'
|'楼梯'
指定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 thestem
function.'楼梯'
– 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 thestairs
function. Stair-step graphs are useful for drawing time history graphs of digitally sampled data.
UI Use
Open the风格对话框并设置Plot type。
轴尺度
—Axes scaling mode
'OnCeatStop'
(default) |'汽车'
|'Manual'
|'Updates'
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
Name
—Window name
“阵列图”
(default) |character vector|string
指定范围的名称。此名称显示为示波器图窗口的标题。要指定范围图的标题,请使用Titleproperty.
Data Types:char
|string
位置
—Scope window position in pixels
screen center(default) |[left bottom width height]
Specify, in pixels, the size and location of the scope window as a four-element vector of the form[left bottom width height]
。默认情况下,范围窗口出现在屏幕的中心,宽度为800
pixels and height of450
pixels. The default values for this property may change depending on your screen resolution.
降低
—Reduce updates to improve performance
真的
(default) |false
真的
- 范围日志数据以供以后使用和定期更新窗口。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。
MaximizeAxes
—最大化轴control
'汽车'
(default) |'On'
|'Off'
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:
Tunable:Yes
UI Use
Open theConfiguration Properties。On the主要的选项卡,设置最大化轴。
Title
—显示标题
''
(default) |character vector|string
将显示标题指定为字符向量或字符串。要使用输入名称作为显示标题,请输入'%
。
Tunable:Yes
UI Use
Open theConfiguration Properties。On theDisplay选项卡,设置Title。
showlegend
—Show legend
false
(default) |真的
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。
ChannelNames
—Channel names
空单元(default) |细胞array of character vectors
指定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, setshowlegend
to真的
。
UI Use
On the legend, double-click the channel name.
ShowGrid
—Display grid
真的
(default) |false
将此属性设置为真的
to show gridlines on the plot.
Tunable:Yes
UI Use
Open theConfiguration Properties。On theDisplay选项卡,设置Show grid。
PlotAsMagnitudePhase
—绘制信号作为大小和相位
false
(default) |真的
当您将此属性设置为真的
, 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选项卡,选择绘图信号作为大小和相位。
XLabel
—X-axis label
''
(default) |character vector
指定文本的范围以显示下方的范围x-axis.
Tunable:Yes
UI Use
Open theConfiguration Properties。On theDisplay选项卡,设置X-label。
ylabel
—y- 轴标签
'Amplitude'
(default) |character vector|string
指定文本以显示范围在y-axis.
Tunable:Yes
Dependencies
此属性仅适用PlotAsMagnitudePhase
是false
。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
YLIMITS
—y-axis limits
[-10,10]
(default) |[ymin, ymax]
指定y-axis limits as a two-element numeric vector,[ymin, ymax]
。
如果PlotAsMagnitudePhase
是false
, 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 thestep
function to run the System object™ algorithm. The arguments tostep
are 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
范围(
displays the signal in the Array Plot.signal
)
范围(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属性以启用多个输入信号。
输入参数
signal
—Input signal or signals to visualize
标量|向量|matrix
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)
Examples
绘制高斯分布
不te: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the object with the equivalentstep
syntax. 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 equivalentstep
syntax. 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
Extended Capabilities
C/C++ Code Generation
使用MATLAB®CODER™生成C和C ++代码。
用法notes and limitations:
Supports MEX code generation by treating the calls to the object as extrinsic. Does not support code generation for standalone applications.
SeeMATLAB代码生成中的系统对象(MATLAB编码器)。
See Also
在R2013a中引入
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.
选择一个网站
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:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
选择the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
美洲
- América Latina(Español)
- 加拿大(English)
- 美国(English)
欧洲
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- 葡萄牙(English)
- 瑞典(English)
- 瑞士
- United Kingdom(English)