%    graphic.m example of program for Matlab 6.0 
%    graphical inteface for plot any function
%    this program may run from Matlab command window or to prepare
%    standalone applications  by command from matlab command window
%    mcc -m -B sgl graphic.m
%    Copyright (C) 2001  Valery Beloshapkin
%
%    This program is free software; you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation; either version 2 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program; if not, write to the Free Software
%    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%
%   e-mail adress of author:  bvv@tnp.krasn.ru 

function graphic()
%#function myplot
global x0 dx xend fun 
h1=figure;
a1=axes('units','normalized','position',[0.1 0.1 0.8 0.5]);
set(h1,'currentaxes',a1,'numbertitle','off','name','grafik f(t)');
xlabel('t');
ylabel('f');
pos=[0.1 0.7 0.1 0.05];
x0=uicontrol('style','edit','units','normalized','position',pos,'string','0');
pos1=[0.1 0.77 0.1 0.05];
dx=uicontrol('style','edit','units','normalized','position',pos1,'string','0.1');
pos2=[0.1 0.84 0.1 0.05];
xend=uicontrol('style','edit','units','normalized','position',pos2,'string','1');
pos3=[0.01 0.7 0.07 0.05];
uicontrol('style','text','units','normalized','position',pos3,'string','t0');
pos4=[0.01 0.77 0.07 0.05];
uicontrol('style','text','units','normalized','position',pos4,'string','dt');
pos5=[0.01 0.84 0.07 0.05];
uicontrol('style','text','units','normalized','position',pos5,'string','tend');
pos6=[0.01 0.91 0.07 0.05];
uicontrol('style','pushbutton','units','normalized','position',pos6,...
'string','plot','backgroundcolor',[1 0 0],'callback','myplot');
pos7=[0.3 0.91 0.5 0.05];
fun=uicontrol('style','edit','units','normalized','position',pos7,'string',...
'cos(2*pi*t).*exp(-t.^2)');
pos8=[0.2 0.91 0.08 0.05];
uicontrol('style','text','units','normalized','position',pos8,'string','f(t)=');





