Simulink.sdi.getBorderOn

Get border display setting for time plots

Description

example

border = Simulink.sdi.getBorderOn returns the current setting for whether borders are displayed on time plots in the Simulation Data Inspector. The return value corresponds to the setting for Show border in the Simulation Data Inspector Time Plot Settings. The setting applies to all time plots in the layout. By default, the Simulation Data Inspector displays the border on time plots.

Examples

collapse all

You can use the Simulink.sdi.setBorderOn function to show or hide the border on time plots in the Simulation Data Inspector. By default, the Simulation Data Inspector shows the border on time plots.

This example starts by showing how to use the Simulink.sdi.getBorderOn function to determine whether the border is currently displayed. Subsequent sections show the code to hide and show the border. To show the result, the example generates an image using the Simulink.sdi.snapshot function with settings specified by a Simulink.sdi.CustomSnapshot object.

snapSettings = Simulink.sdi.CustomSnapshot;
snapSettings.Width = 300;
snapSettings.Height = 300;

Get Current Border Display Setting

Before modifying the border display setting for time plots, you can save the current setting to a variable in the workspace in case you want to restore the preference later.

border = Simulink.sdi.getBorderOn;

Hide the Border on Time Plots

Simulink.sdi.setBorderOn(false)
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Show the Border on Time Plots

Simulink.sdi.setBorderOn(true)
Simulink.sdi.snapshot('from','custom','settings',snapSettings);

Output Arguments

collapse all

Border display setting for time plots in the Simulation Data Inspector.

  • true or 1 — Border displayed for time plots.

  • false or 0 — Border hidden for time plots.

Introduced in R2019b