주요 콘텐츠

Simulink.sdi.clearSubPlot

R2026b

Clear plotted signals from single subplot in Simulation Data Inspector

Since R2024b

    Description

    Simulink.sdi.clearSubPlot(r,c) clears plotted signals from the subplot at the location specified by r and c on the active tab in the Simulation Data Inspector.

    example

    Simulink.sdi.clearSubPlot(r,c,TabIndex=idx) clears plotted signals on the Simulation Data Inspector tab specified by the tab index idx instead of the active tab.

    example

    Examples

    collapse all

    Use the Simulink.sdi.clearSubPlot function to programmatically clear plotted signals from a single subplot. For example, clear plotted signals from the subplot in the first row and second column of a subplot layout.

    Simulink.sdi.clearSubPlot(1,2)

    To clear plotted signals from a subplot on a specific tab, specify the tab index using the TabIndex name-value argument. For example, clear plotted signals from the subplot in the first row and second column of the third tab in the Simulation Data Inspector.

    Simulink.sdi.clearSubPlot(1,2,TabIndex=3)

    Input Arguments

    collapse all

    Subplot row index, specified as an integer between 1 and 8, inclusive. Use the r and c inputs together to specify the location of the subplot for which you want to get the visualization type. For more information about how the Simulation Data Inspector indexes subplots, see Move Between Subplot Layouts.

    Subplot column index, specified as an integer value between 1 and 8, inclusive. Use the r and c inputs together to specify the location of the subplot for which you want to get the visualization type. For more information about how the Simulation Data Inspector indexes subplots, see Move Between Subplot Layouts.

    Since R2026b

    Tab index, specified as a positive integer between 1 and 8, inclusive. Tabs are indexed from 1 to 8, left to right in the Simulation Data Inspector. Reordering tabs in the Simulation Data Inspector updates the indices.

    You can also locate a tab programmatically using the TabsList property of the Simulink.sdi.TabGroup object. For example, the tab named Tab2 is at index 2.

    tabGrp = Simulink.sdi.TabGroup;
    allTabs = tabGrp.TabsList;
    fprintf("%-10s %-10s %-10s %-10s\n", "Name","Color","Index","IsActive");
    for k = 1:numel(allTabs)
        fprintf("%-10s %-10s %-10d %-10d\n",allTabs(k).Name, ...
            allTabs(k).Color,allTabs(k).Index,allTabs(k).IsActive);
    end
    Name       Color      Index      IsActive  
    Tab1       none       1          0         
    Tab2       none       2          0         
    Tab3       none       3          1    

    When you do not specify TabIndex, the function operates on the active tab.

    Example: TabIndex=2

    Version History

    Introduced in R2024b

    expand all