Main Content


Customize data labels for cursor measurements



setCursorDataLabels(obj,labels) customizes the data labels that appear in the tool tip of cursor measurements in the dsp.MatrixViewer.


collapse all

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,...
scope = dsp.MatrixViewer(...
    "ColorBarLabel","Power/Frequency (dB/Hz)",...
    "XLabel","Frequency (Hz)",...
    "YLabel","Time (secs)",...
y = chirp() + 0.05*randn(frameSize,1);
[~,~,~,Ps] = spectrogram(y,128,120,128,1e3);
val = 10*log10(abs(Ps)'+eps);

Change the data labels for the cursor measurements to match the type of data in the matrix.


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

collapse all

Matrix viewer whose data labels you want to customize.

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