Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

uitabgroup

Create container for tabbed panels

Syntax

tg = uitabgroup
tg = uitabgroup(parent)
tg = uitabgroup(___,Name,Value)

Description

tg = uitabgroup creates a tab group in the current traditional figure and returns the tab group object. If no traditional figure exists, then MATLAB® creates one and places the tab group in it. Tab groups are tab containers. They allow you to group tabs together, identify the currently selected tab, and detect when the app user selects a different tab.

tg = uitabgroup(parent) creates a tab group and specifies the parent object for the tab group.

example

tg = uitabgroup(___,Name,Value) specifies tab group property values using one or more Name,Value pair arguments. Use this option with any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Create a figure containing a uitabgroup and two uitabs.

f = figure;
tabgp = uitabgroup(f,'Position',[.05 .05 .3 .8]);
tab1 = uitab(tabgp,'Title','Type of Signal');
tab2 = uitab(tabgp,'Title','Plot Options');

Get the currently selected uitab.

currenttab = tabgp.SelectedTab
currenttab = 

  Tab (Type of Signal) with properties:

              Title: 'Type of Signal'
    BackgroundColor: [0.9400 0.9400 0.9400]
           Position: [0.0119 0.0089 0.9702 0.9107]
              Units: 'normalized'

Create a UI figure window containing a tab group that contains two tabs.

fig = uifigure;
tabgp = uitabgroup(fig,'Position',[100,100,250,210]);
tab1 = uitab(tabgp,'Title','Type of Signal');
tab2 = uitab(tabgp,'Title','Plot Options');

Get the currently selected tab.

currenttab = tabgp.SelectedTab
currenttab = 

  Tab (Type of Signal) with properties:

              Title: 'Type of Signal'
    BackgroundColor: [0.9400 0.9400 0.9400]
           Position: [1 1 250 210]
              Units: 'pixels'

Input Arguments

collapse all

Parent object of tab group, specified as a Figure, Panel, Tab object or ButtonGroup object. The parent object can be within a traditional figure or a UI figure.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'TabLocation','bottom' specifies that the tab labels are at the bottom of the tab group.
  • For information on Name-Value pair arguments you can use with tab groups in traditional figure windows, see Uitabgroup Properties.

  • For information on Name-Value pair arguments you can use with tab groups in UI figure windows, see TabGroup Properties.

More About

collapse all

traditional figure

A traditional figure is one that MATLAB creates when you use GUIDE or the figure function. For more information on the difference between traditional figures and UI figures, see Graphics Support in App Designer.

UI figure

A UI figure is one that MATLAB creates when you use App Designer or the uifigure function. For more information on the difference between traditional figures and UI figures, see Graphics Support in App Designer.

Introduced in R2014b

Was this topic helpful?