Main Content

Simulink.sdi.getBorderOn

Get border display setting for time plots

Since R2019b

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 value of the Show border setting on the Time Plot section of the Visualization Settings in the Simulation Data Inspector. 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);

Figure contains an axes object. The axes object contains an object of type image.

Show the Border on Time Plots

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

Figure contains an axes object. The axes object contains an object of type image.

Output Arguments

collapse all

Border display setting for time plots in the Simulation Data Inspector, returned as true (1) or false (0).

  • true or 1 — Border displayed for time plots.

  • false or 0 — Border hidden for time plots.

Version History

Introduced in R2019b