setCursorDataLabels
Customize data labels for cursor measurements
Description
Examples
Set Cursor Labels on dsp.MatrixViewer
This example shows how to set the data labels for the cursor measurements on the dsp.MatrixViewer
System object.
Display a chirp signal on the dsp.MatrixViewer
scope.
Fs = 233e3; frameSize = 20e3; chirp = dsp.Chirp("SampleRate",Fs,"SamplesPerFrame",frameSize,... "InitialFrequency",11e3,"TargetFrequency",11e3+55e3,... "Type","Quadratic"); scope = dsp.MatrixViewer(... "ColorBarLabel","Power/Frequency (dB/Hz)",... "XLabel","Frequency (Hz)",... "YLabel","Time (secs)",... "Colormap","hsv",... "ColorLimits",[-100,-30]); y = chirp() + 0.05*randn(frameSize,1); [~,~,~,Ps] = spectrogram(y,128,120,128,1e3); val = 10*log10(abs(Ps)'+eps); scope(val);
Change the data labels for the cursor measurements to match the type of data in the matrix.
setCursorDataLabels(scope,["Hz","Sec","db/Hz"])
Enable the cursor measurements by selecting the cursor button in the axes toolbar. When you hover over the cursor, the tooltip shows you the data values with the new data labels.
Input Arguments
obj
— Matrix viewer
dsp.MatrixViewer
System object™
Matrix viewer whose data labels you want to customize.
labels
— Label customization vector
["X","Y","Value"]
(default) | 3-by-1 string array
Specify the label names as a three-element string array. The first element corresponds to the x-data, the second element to the y-data, and the third element to the matrix value.
Example: ["freq","time","power"]
Data Types: char
| string
Version History
Introduced in R2019a
See Also
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)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)