주요 콘텐츠

Simulink.sdi.setCursorOptions

R2026b

Configure shading options for cursors in Simulation Data Inspector

    Description

    Simulink.sdi.setCursorOptions(Name=Value) configures shading options for cursors in the Simulation Data Inspector according to one or more name-value arguments. You can specify the area to shade, the color and opacity of the shaded region, and whether signal data is emphasized in the shaded region. For example, to apply shading to the area between two cursors, set ShadeArea="inbetween".

    example

    Examples

    collapse all

    To draw attention to a region of interest in a time plot, configure shading options for cursors. You can emphasize or de-emphasize the signal data in the shaded region, and specify the shading color and opacity. By default, to de-emphasize signal data, the Simulation Data Inspector shades areas gray with an opacity of 0.7. To emphasize data, the Simulation Data Inspector shades areas light blue with an opacity of 0.7.

    Suppose you want to highlight a signal transition that occurs between two cursors. To emphasize this area where the transition occurs, you can highlight the area between the cursors with a light yellow.

    Simulink.sdi.setCursorOptions(Emphasize=true,...
      ShadeArea="inbetween",ShadeColor=[1 1 0.6]);

    To programmatically see the current cursor shading configuration, use Simulink.sdi.getCursorOptions.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: ShadeArea="lead",ShadeOpacity=0.5 configures cursors to shade the area that leads the left-most cursor with an opacity of 0.5.

    Where to apply cursor options, specified as "inspect" or "compare". You can configure independent cursor options for the Inspect and Compare panes in the Simulation Data Inspector.

    Example: Type="compare" configures cursor options for the Compare pane.

    Whether signal data is emphasized in shaded region, specified as true or false. When emphasized, the signal data is plotted on top of the cursor shading.

    Example: Emphasize=false configures cursor options to plot signal data under shaded region.

    Area to shade relative to cursors, specified as one of these options:

    • "none" — Do not shade any plot area.

    • "lead" — Shade the plot area that leads the left-most cursor.

    • "lag" — Shade the plot area that lags the right-most cursor.

    • "leadandlag" — Shade the plot area outside of the cursors, when two cursors are displayed.

    • "inbetween" — Shade the plot area between the cursors, when two cursors are displayed.

    Example: ShadeArea="none" configures cursor options to not shade any region relative to the cursors.

    Color of the shaded area, specified as an r g b vector with values between 0 and 1.

    Example: ShadeColor=[0 0 1] configures the color of the shaded area as blue.

    Opacity of the shaded area, specified as a percentage value between 0 and 1.

    Example: ShadeOpacity=0.5 configures the opacity of the shaded area as 0.5.

    Version History

    Introduced in R2020a