Main Content

CursorMeasurementsConfiguration

Display waveform cursors

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

    Time Scope Toolstrip

    Snapshot showing cursor measurements in Time Scope toolstrip.

    Creation

    Description

    example

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

    Properties

    expand all

    All properties are tunable.

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

    Scope Window Use

    Click the Measurements tab on the scope toolstrip. In the Cursors section, select Data Cursors and click the drop-down for Data Cursors. Specify the two elements in X location edit fields.

    Data Types: double

    Snap cursors to data, specified as true or false.

    Scope Window Use

    Click the Measurements tab on the scope toolstrip. In the Cursors section, click the drop-down for Data Cursors, and then select Snap to data.

    Data Types: logical

    Set this property to true to lock the spacing between the cursors.

    Scope Window Use

    Click the Measurements tab on the scope toolstrip. In the Cursors section, click the drop-down for Data Cursors, and then 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

    Click the Measurements tab on the scope toolstrip. In the Cursors section, 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