Main Content

CursorMeasurementsConfiguration

Measure signal values using vertical waveform cursors that track along the signal

Since R2022a

    Description

    Use the CursorMeasurementsConfiguration object to enable waveform cursors. You can control the cursor settings from the toolstrip of the scope or from the command line.

    To display vertical cursors on each signal and to modify the cursor settings in the scope UI, click the Measurements tab and enable Data Cursors. Each cursor tracks a vertical line along the signal. The scope displays the difference between x- and y-values of the signal at the two cursors in the box between the cursors. The cursors appear only when the scope has at least one signal in its display. You can use the mouse to move the vertical cursors left and right.

    Time Scope Toolstrip

    Snapshot showing cursor measurements in Time Scope toolstrip.

    Creation

    Description

    cursormeas = CursorMeasurementsConfiguration() creates a cursor measurements configuration object.

    example

    Properties

    expand all

    All properties are tunable.

    x-coordinates of the cursors, specified as a two-element vector of real numbers.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to specify the two elements in X location properties.

    Data Types: double

    Position cursors on the signal data points, specified as true or false.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to select Snap to data.

    Data Types: logical

    Lock spacing between cursors, specified as true or false. Set this property to true to lock the frequency difference between the cursors.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to select Lock cursor spacing.

    Data Types: logical

    Enable cursor measurements, specified as true or false. Set this property to true to enable cursor measurements.

    Scope Window Use

    On the Measurements tab, select Data Cursors.

    Data Types: logical

    Examples

    collapse all

    Create a sine wave and view it in the Time Scope. Enable data cursors programmatically.

    Initialization

    Create the input sine wave using the sin function. Create a timescope MATLAB® object to display the signal. Set the TimeSpan property to 1 second.

    f = 100;
    fs = 1000;
    swv = sin(2.*pi.*f.*(0:1/fs:1-1/fs)).';
    scope = timescope(SampleRate=fs,...
        TimeSpanSource="property",...
        TimeSpan=1);

    Data Cursors

    Enable data cursors in the scope programmatically by setting the Enabled property of the CursorMeasurementsConfiguration object to true.

    scope.CursorMeasurements.Enabled = true;
    scope(swv);
    release(scope)

    Version History

    Introduced in R2022a

    expand all