function MTB_GUI1

Monitor = get(0,'ScreenSize');
x_size = 550;
y_size = 350;

figure(...
   'units', 'pixels', ...
   'Position',...
   [Monitor(3)/2-x_size/2 ...
   Monitor(4)/2-y_size/2 ...
   x_size y_size],...
   'Name', 'Pøíklad1', ...
   'Tag','fig_Priklad1', ...
   'Color',[0.8 0.8 0.8]);

uicontrol(...
   'Units', 'Normalized', ...
   'Position', [0.1 0.1 0.15 0.1], ...
   'Style', 'Push', ...
   'String', 'Konec', ...
   'Callback',@(scr,event)endFunction, ...
   'ForegroundColor', [0.7 0.8 0.8], ...
   'BackgroundColor', [0.1 0.4 1], ...
   'Fontsize', 9);

hndl = uicontrol(...
   'Units', 'Normalized', ...
   'Position',[0.05 0.45 0.25 0.1], ...
   'Style', 'Edit', ...
   'String','sin(0:0.01:2*pi)',...
   'ForegroundColor','black',...
   'BackgroundColor','w', ...
   'Fontweight','bold',...
   'Fontsize',11);

osy = axes(...
   'units','Normalized',...
   'Position',[0.35 0.1 0.625 0.85],...
   'Color',[0.98 0.98 0.98],...
   'Box','on');

uicontrol(...
   'Units', 'Normalized', ...
   'Position', [0.1 0.75 0.15 0.1], ...
   'Style', 'Push', ...
   'String', 'Stiskni',...
   'Callback', @(scr,event)pressButton(hndl,osy), ...
   'ForegroundColor', 'white',...
   'BackgroundColor', [0.1 0.7 0.2], ...
   'Fontweight', 'bold',...
   'Fontsize', 11);
end

function pressButton(source,ax)
try
   dta = eval(get(source,'String'));
   reset(ax);
   plot(ax,dta,'-x');
   set(source,'BackgroundColor','w');
catch
   fprintf(2,'V prikazu je chyba!!\n');
   set(source,'BackgroundColor','r');
end
end

function endFunction
closereq;
end
