Here is a very simple example.
function GUI()
%write a statement in each of the input boxes
gui = figure('MenuBar','none','Name','YourName','Visible','off','Position',[300,300,850,500]);
cipher = uipanel('Title','YourTitle','Units','pixels','Position',[8 8 700 484],'BackgroundColor',[0.9 0.9 0.9]);
input1 = uicontrol('Parent',cipher,'Style','text','String','Do:','Units','pixels','Position',[3 420 50 16],'BackgroundColor',[0.9 0.9 0.9],'HorizontalAlignment','left');
input_area1 = uicontrol('Parent',cipher,'Style','edit','String','','Max',2,'Units','pixels','Position',[52 380 638 70],'BackgroundColor',[1 1 1],'HorizontalAlignment','left');
input2 = uicontrol('Parent',cipher,'Style','text','String','Key:','Units','pixels','Position',[6 360 43 16],'BackgroundColor',[0.9 0.9 0.9],'HorizontalAlignment','left');
input_area2 = uicontrol('Parent',cipher,'Style','edit','String','','Max',2,'Units','pixels','Position',[52 347 638 30],'BackgroundColor',[1 1 1],'HorizontalAlignment','left');
output = uicontrol('Parent',cipher,'Style','text','String','Get:','Units','pixels','Position',[3 315 50 16],'BackgroundColor',[0.9 0.9 0.9],'HorizontalAlignment','left');
output_area = uicontrol('Parent',cipher,'Style','edit','String','','Max',2,'Units','pixels','Position',[52 120 638 220],'BackgroundColor',[1 1 1],'HorizontalAlignment','left');
options = uibuttongroup('Title','Options','Units','pixels','Position',[714 260 130 232],'BackgroundColor',[0.9 0.9 0.9]);
doButton = uicontrol('Parent',options,'Style','pushbutton','String','DoButton','Units','pixels','Position',[4 130 120 60],'BackgroundColor',[0.9 0.9 0.9],'Callback',@doB_Callback);
getButton = uicontrol('Parent',options,'Style','pushbutton','String','GetButton','Units','pixels','Position',[4 70 120 60],'BackgroundColor',[0.9 0.9 0.9],'Callback',@getB_Callback);
reset = uicontrol('Parent',options,'Style','pushbutton','String','Reset','Units','pixels','Position',[4 5 120 60],'BackgroundColor',[0.9 0.9 0.9],'Callback',@reset_Callback);
status = uicontrol('Style','text','String','','Units','pixels','Position',[714 235 130 20],'HorizontalAlignment','left');
gui.Visible = 'on';
function doB_Callback(src,event)
output_area.String = [input_area1.String,input_area2.String];
status.String = 'Done';
end
function getB_Callback(src,event)
input_area1.String = [input_area2.String,output_area.String];
status.String = 'Done';
end
function reset_Callback(src,event)
input_area1.String = '';
input_area2.String = '';
output_area.String = '';
end
end