Main Content

Simulink.sdi.setPosition

Set position and size of Simulation Data Inspector

Since R2022b

    Description

    Simulink.sdi.setPosition(pos) sets the position and size of the Simulation Data Inspector window based on the values in the vector, pos. The Simulation Data Inspector must be open before changing the position or size of the window.

    example

    Examples

    collapse all

    This example shows you how to change the position and size of the Simulation Data Inspector window. First, open the Simulation Data Inspector.

    Simulink.sdi.view

    Set the Simulation Data Inspector window to be:

    • 800 pixels wide

    • 500 pixels high

    • 200 pixels from the left edge of your primary display

    • 60 pixels from the bottom of your primary display

    pos = [200 60 800 500];
    Simulink.sdi.setPosition(pos)

    Alternatively, you can move and resize the Simulation Data Inspector manually. To use this placement in future simulations, retrieve the position vector using the function Simulink.sdi.getPosition.

    newPos = Simulink.sdi.getPosition
    newPos = 1×4
    
             128         112        1024         800
    
    

    Input Arguments

    collapse all

    Position and size of the Simulation Data Inspector window, specified as a four-element vector in the form [left bottom width height]. All measurements have units of pixels.

    ElementDescription
    leftDistance from the left edge of the primary display to the inner-left edge of the window. This value can be negative on systems that have more than one monitor.
    bottomDistance from the bottom edge of the primary display to the inner-bottom edge of the window. This value can be negative on systems that have more than one monitor.
    widthDistance between the right and left inner edges of the window.
    heightDistance between the top and bottom inner edges of the window.

    Version History

    Introduced in R2022b