Contenido principal

Simulink.sdi.Tab

R2026b

Access and manage Simulation Data Inspector tab

Since R2026b

    Description

    A Simulink.sdi.Tab object contains information for an individual tab in the Simulation Data Inspector. Use the Tab object to access and modify properties of a tab. For example, you can rename a tab, reorder tabs, or set a particular tab as visible.

    Creation

    The software creates a Simulink.sdi.Tab object for each open tab in the Simulation Data Inspector. These tabs are grouped as elements in the Simulink.sdi.TabGroup object. To access a Tab object, get the element from the TabGroup object using one of these functions:

    Properties

    expand all

    Tab name, specified as a string or character vector. By default, tab names are generated using incremental naming from Tab1 to Tab8.

    Example: tab2.Name = "New Tab Name"

    Tab color, specified as "none", "red", "green", "blue", "orange", "purple", or "yellow". When you set this property to one of these values, a dot of the corresponding color appears on the tab.

    Example: tab2.Color = "orange"

    This property is read-only.

    Tab index, returned as a positive integer between 1 and 8, inclusive. Tabs are indexed from 1 to 8, left to right. Reordering tabs in the Simulation Data Inspector updates the indices. The index also corresponds to the position of the Tab object in the TabList property of the Simulink.sdi.TabGroup object.

    Example: 2

    This property is read-only.

    Whether tab is the active tab, returned as one of these options:

    • 0 — The tab is not active.

    • 1 — The tab is the active tab.

    Object Functions

    closeOtherTabsClose all but specified tab in Simulation Data Inspector
    closeTabClose Simulation Data Inspector tab
    setActiveTabSpecify active Simulation Data Inspector tab

    Examples

    collapse all

    Access the Tab object for the Simulation Data Inspector tab named Tab2.

    tabGrp = Simulink.sdi.TabGroup;
    tab2 = getTabByName(tabGrp,"Tab2")
    tab2 = 
    
      Tab with properties:
    
            Name: 'Tab2'
           Color: 'none'
           Index: 2
        IsActive: 0

    You can programmatically change the name or color of a tab using the Tab object properties. For example, change the name and color of the second tab.

    1. Access the Tab object at index 2.

    2. Change the tab name to myTab2 using the Name property.

    3. Highlight the tab with an orange dot using the Color property.

    tabGrp = Simulink.sdi.TabGroup;
    tab2 = getTabByIndex(tabGrp,2);
    tab2.Name = "myTab2";
    tab2.Color = "orange"
    tab2 = 
    
      Tab with properties:
    
            Name: 'myTab2'
           Color: 'orange'
           Index: 2
        IsActive: 0
    

    Version History

    Introduced in R2026b