User`s guide

LayOuttheSimpleProgrammaticGUI
4 Align all components except the axes along their centers with the following
statement. Add it to the code file following all the component definitions.
align([hsurf,hmesh,hcontour,htext,hpopu p],'Center','None');
5 Make your GUI visible by adding this command following the align
command.
set(f,'Visible','on')
6 This is what your code file should now look like:
function simple _gui 2
% SIMPLE_GUI 2 Select a data set from the pop-u p menu, then
% click one of the plot-typ e push buttons. Cli cking the button
% plots the selected data i n the axes.
% Create and hide the GUI as it is being constructed.
f = figure('Visible','off','Pos ition',[360,500,450,285] );
% Construct the components.
hsurf = uicontrol('Style','push button','String','Surf', ...
'Position',[315,220,70,25]);
hmesh = uicontrol('Style','push button','String','Mesh', ...
'Position',[315,180,70,25]);
hcontour = uicontrol('Style','p ushbutton',...
'String','Countour',...
'Position',[315,135,70,25]);
htext = uicontrol('Style','text ','String','Select Data',...
'Position',[325,90,60,15]);
hpopup = uicontrol('Style','pop upmenu',...
'String',{'Peaks','Membrane','Sinc'},. ..
'Position',[300,50,100,25]);
ha = axes('Units','Pixels','Pos ition',[50,60,200,185]);
align([hsurf,hmesh,hcontour,htext,hp opup],'Center','None');
%Make the GUI visible.
set(f,'Visible','on')
end
3-9