Create panel container object
p = uipanelp = uipanel(Name,Value)p = uipanel(parent)p = uipanel(parent,Name,Value)p = uipanel creates a panel in an existing traditional figure and returns the panel
object. If there is no figure available, then MATLAB® creates
a new traditional figure to serve as the parent. Panels are containers
that group UI components together, including other panels. Panels
cannot contain ActiveX® controls.
p = uipanel( specifies
one or more panel property names and corresponding values. Use this
syntax to override the default panel properties.Name,Value)
p = uipanel(parent, specifies
panel property values using one or more Name,Value)Name,Value pair
arguments.
Create a traditional figure containing two
panels and a push button. The panels use the default Units property
value, 'normalized'. The default units for the uicontrol is 'pixels'
h = figure; hp = uipanel('Title','Main Panel','FontSize',12,... 'BackgroundColor','white',... 'Position',[.25 .1 .67 .67]); hsp = uipanel('Parent',hp,'Title','Subpanel','FontSize',12,... 'Position',[.4 .1 .5 .5]); hbsp = uicontrol('Parent',hsp,'String','Push here',... 'Position',[18 18 72 36]);

Create a UI figure containing two panels and
a button. The panels and button position measurements are in 'pixels'.
fig = uifigure; pnl = uipanel(fig,'Title','Main Panel','FontSize',12,... 'BackgroundColor','white',... 'Position',[20 20 440 321]); subpnl = uipanel(pnl,'Title','Subpanel','FontSize',12,... 'Position',[20 20 170 200]); btn = uibutton(subpnl,'Text','Push here',... 'Position', [20 20 75 36]);
