Add Components to a Programmatic App
User interface controls are common UI components, such as buttons, check boxes, and
sliders. Tables present data in rows and columns. Panels and button groups are
containers in which you can group together related elements in your UI. ActiveX
components enable you to display ActiveX controls.
User Interface Controls
Push Button
This code creates a push button:
f = figure;
pb = uicontrol(f,'Style','pushbutton','String','Button 1',...
'Position',[50 20 60 40]);
The first uicontrol argument, f, specifies the parent container. In this case, the parent
is a figure, but you can also specify the parent to be any container, such as a panel or
button group.
The name-value pair arguments, 'Style','pushbutton', the uicontrol to be a push
button.
9 Lay Out a Programmatic UI