uitabgroup

Creates a tabbed frame for interactive graphical control objects in a figure.

Syntax

h = uitabgroup()

h = uitabgroup(property, value, ...)

h = uitabgroup(parent, property, value, ...)

Inputs

parent
Handle of a container object, which could be a figure, frame, uipanel, or uibuttongroup.
Type: double | integer
property, value
createfcn
Function triggered when h is created.
If value is a function handle, it must be a function that takes at least two arguments: the first is the handle and the second argument is ignored.
If value is a string, it must represent a function handle or a function name.
If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to the callback function in the additional elements.
createfcn cannot be interrupted.
Type: cell | functionhandle | string
deletefcn
Function triggered when h is deleted.
If value is a function handle, it must be a function that takes at least two arguments: the first is the handle and the second argument is ignored.
If value is a string, it must represent a function handle or a function name.
If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to the callback function in the additional elements.
deletefcn cannot be interrupted.
Type: cell | functionhandle | string
enable
Specifies if h is enabled. Valid values are on(default) and off.
Type: string
fontangle
Specifies the angle of the displayed font in all tabs. Valid values are regular(default) and italic.
Type: string
fontname
Specifies the name of the displayed font in all tabs.
Type: string
fontsize
Specifies the size of the displayed font in all tabs.
Type: scalar
fontunits
Determines if fontsize property is absolute or relative based on fontsize of the parent of h. Valid values are pixels (default) and normalized.
Type: string
fontweight
Specifies the weight of the displayed font in all tabs. Valid values are normal(default) and bold.
Type: string
interruptible
Specifies if selectionchangedfcn can be interrupted by clicking on the Stop button in the user interface. Valid values are off (default) and on.
Type: string
parent
Specifies the parent.
Type: scalar
position
Position and size of h. Value is specified as a vector of form: [left top width height]. If units has a value of normalized, values must be between 0 to 1.
Type: vector
selectedtab
Handle of the uitab child that needs to be selected. By default, the last tab added is selected.
Type: scalar
selectionchangedfcn
Callback function triggered when a uitab child is selected and made current.
If value is a function handle, it must be a function that takes at least two arguments: the first is the handle, and the second is the event data to the uitab.
If value is a string, it must represent a function handle or a function name.
If value is a cell, it must contain the function name/function handle in the first cell element and parameters to pass to the callback function in the additional elements.
selectionchangedfcn can be interrupted using the property interruptible with a value of on.
Type: cell | functionhandle | string
tag
User defined string to tag h.
Type: string
tooltipstring
Tooltip.
Type: string
units
Specifies units of measurement. Valid values are pixels(default) and normalized.
pixels
Indicates that h has a fixed size and position specified by position.
normalized
Indicates that h is resized if parent is resized.
Type: string
userdata
User defined numerical data.
Type: complex | mtx | scalar
value
User defined scalar data.
Type: scalar
visible
Specifies if h is visible. Valid values are on(default) and off.
Type: string

Outputs

h
Handle of the uitabgroup created.

Example

Create a tabbed frame, with tabs containing uicontrol elements in the current figure:
% Callback function
function tabselectedfcn(handle, data, varargin)
  printf('Selected tab handle: [%f]\n', get(handle, 'selectedtab'));
end

h = uitabgroup(gcf(), 'selectionchangedfcn', 'tabselectedfcn');

% Creates individual tabs
tab1 = uitab(h, 'title', 'My tab 1')
tab2 = uitab(h)

% Keeps the first tab created as the selected tab
set(h, 'selectedtab', tab1);

% Creates uicontrol elements in individual tabs
edithandle = uicontrol(tab1,'style','edit','string','169','units','normalized','position',[0.1 0.15 0.15 0.15]);

lst10 = uicontrol(tab2, 'Style','listbox','units','normalized', ...
'String',{'data1','data2','data3','data4','data5','data6','data7'},'max',3,'min',0,'value',[2,3],
'visible', 'on', 'units','normalized','position',[0.1 0.1 0.15 0.15]);