Main Content

Simulink.sdi.getCursorOptions

R2026b

Get current shading options for cursors in Simulation Data Inspector

Since R2024a

    Description

    cursorOpts = Simulink.sdi.getCursorOptions returns the current shading configuration for cursors in the Inspect pane of the Simulation Data Inspector. Configuration options include the area to shade, the color and opacity of the shaded region, and whether signal data is emphasized in the shaded region.

    To set cursor shading options, use Simulink.sdi.setCursorOptions.

    example

    cursorOpts = Simulink.sdi.getCursorOptions(Type=pane) returns the shading configuration for cursors in either the Inspect or Compare pane of the Simulation Data Inspector.

    Examples

    collapse all

    colorOpts = Simulink.sdi.getCursorOptions
    colorOpts = 
    
      struct with fields:
    
           shadeType: 'emphasize'
           shadeArea: 'inbetween'
          shadeColor: '#ffff99'
        shadeOpacity: 0.9000

    Input Arguments

    collapse all

    Where to get cursor options configuration from, specified as one of these options:

    • "inspect" — Get cursor shading configuration from the Inspect pane of the Simulation Data Inspector.

    • "compare" — Get cursor shading configuration from the Compare pane of the Simulation Data Inspector.

    Output Arguments

    collapse all

    Cursor shading configuration, returned as a structure with these fields specifying the current cursor options:

    • shadeType — Whether the signal data is emphasized in shaded region, returned as 'emphasize' (default) or 'deemphasize'.

    • shadeArea — Shaded area relative to cursors, returned as one of these options:

      • 'none'(default) — Plot area not shaded.

      • 'lead' — Plot area that leads the left-most cursor is shaded.

      • 'lag' — Plot area that lags the right-most cursor is shaded.

      • 'leadandlag' — When two cursors are displayed, plot area outside of the cursors is shaded.

      • 'inbetween' — When two cursors are displayed, plot area between the cursors is shaded.

    • shadeColor — Color of the shaded area, returned as a hexadecimal color code. The default color is #CCE8FF.

    • shadeOpacity — Opacity of the shaded area, returned as a percentage value between 0 and 1. The default opacity is 0.7.

    Version History

    Introduced in R2024a