[tMin,tMax,yMin,yMax] = Simulink.sdi.getSubplotLimits(r,c)
returns the t-axis and y-axis limits for the subplot
at the specified location in the subplot layout on the active tab in the Simulation Data
Inspector.
[tMin,tMax,yMin,yMax] = Simulink.sdi.getSubplotLimits(r,c,TabIndex=idx)
returns the axis limits for the specified subplot on the tab specified by
idx instead of the active tab.
To get the axis limits for a subplot on a specific tab, specify the tab
index using the TabIndex name-value argument. For example, get the axis
limits for the subplot in the first row and first column of the second tab in the
Simulation Data Inspector.
Suppose that you have two vertically aligned subplots in the
Simulation Data Inspector. To copy the y-axis limits used in the upper
subplot to the lower subplot, first get the y-axis limits of the upper
subplot, then apply them to the lower subplot.
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 the axis
limits.
Example: [~,~,yMin,yMax] = Simulink.sdi.setSubplotLimits(3,2)
returns y-axis limits for the time plot in the third row of the
second column of the subplot layout in the Simulation Data Inspector.
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 the axis
limits.
Example: [~,~,yMin,yMax] = Simulink.sdi.setSubplotLimits(2,2)
returns the y-axis limits for the time plot in the second row of the
second column of the subplot layout in the Simulation Data Inspector.
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.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.