setCursorDataLabels

Customize data labels for cursor measurements

Syntax

setCursorDataLabels(obj,labels)

Description

example

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

Examples

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,...
  "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

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

Introduced in R2019a