function example
f=figure('Name','Increment','position',[450 250 500 300],'Color',[1 1 1]);
counter=uicontrol(f,'STyle','pushbutton','String','INCREMENT','CallBack',@count,'fontsize',16,'Position',[125 150 150 30]);
txt=uicontrol(f,'Style','text','String',0,'Position',[5,200,490,40],'fontsize',20);
reset=uicontrol(f,'Style','pushbutton','String','RESET','Callback',@yup,'fontsize',16,'Position',[275 150 100 30]);
w=uicontrol(f,'Style','pushbutton','String','WHY','Callback',@ok,'fontsize',16,'Position',[175 120 100 30]);
t=uicontrol(f,'Style','text','Position',[5,5,490,110],'Visible','off','fontsize',16);
ji=imread('C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Penguins.jpg');
set(t,'CData',ji)


    function count(source,~)
        x=str2num(get(txt,'String'));
        x=x+1;
        set(txt,'String',x);
    end
    function yup(source,~)
        set(txt,'string',0)
    end
    function ok(~,~)
        delete file
        diary('file')
        why
        diary off
        fid=fopen('file','r');
        x=fgetl(fid);
        fclose(fid);
        clc;
        set(t,'String',x,'Visible','on')
    end
end
