function MTB_Week11_GUI1edit

Monitor = get(0,'ScreenSize');
x_size = 550;
y_size = 350;
figure('units','pixels','Name','Pøíklad1','Position',...
    [Monitor(3)/2-x_size/2 Monitor(4)/2-y_size/2 x_size y_size],...
    'Tag','fig_Priklad1','Color',[.8 .8 .8]);
uicontrol('Units','Normalized','Style','Push','String',...
    'Konec','Callback',@(scr,event)endFunction,'ForegroundColor',...
    [.7 .8 .8],'BackgroundColor',[.1 .4 1],...
    'Fontsize',9,'Position',[.1 .1 .15 .1]);
hndl = uicontrol('Units','Normalized','Style','Edit','String',...
    'sin(0:0.01:2*pi)','ForegroundColor',...
    'black','BackgroundColor','w','Fontweight','bold',...
    'Fontsize',11,'Position',[.05 .45 .25 .1]);
osy = axes(...
	'units','Normalized',...
    'Position',[0.35 0.1 0.625 0.85],...
    'Color',[.98 .98 .98],...
    'Box','on');
uicontrol('Units','Normalized','Style','Push','String',...
    'Stiskni','Callback',@(scr,event)pressButton(hndl,osy),'ForegroundColor',...
    'white','BackgroundColor',[.1 .7 0.2],'Fontweight','bold',...
    'Fontsize',11,'Position',[.1 .75 .15 .1]);
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
