function setting(action)
%SETTING GUI window for users to input parameters
%
% See also: LET, README, SETHELP, LETHELP, STARTLET
% by Steve W. K. SIU, July 5, 1998.
if nargin<1
action='initilization';
%Obtain the handles of all GUI components of
%the main window for later use
MainHandles=get(gcf,'UserData');
else
%Get the handles of GUI components of
%the Setting window.
HandlesList=get(gcf,'UserData');
end
action=lower(action);
switch action
case 'initilization'
%Font Size
FontSize=8;
%%%%%%%%%%%%%%%%%%%%%%%%%%
%% INITIALIZATION
%%%%%%%%%%%%%%%%%%%%%%%%%%
%Restore the (default) DATA
DATA=get(MainHandles(4),'UserData');
%Create a GUI Setting Window
%Before creating the setting window, get current axes' handles
AxesHandle=gca;
%Get the data stored in 'UserData' of the "Setting" button
%MainHandles(4) is the handle of "Setting" button
DATA=get(MainHandles(4),'UserData');
%Get the output file and ODE function names stored in
%'UserData' of the "Start" button.
%MainHandles(2) is the handle of "Start" button
NAMES=get(MainHandles(2),'UserData');
OutputFile=rmspace(NAMES(1,:));
odeFunction=rmspace(NAMES(2,:));
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Setting Window
%%%%%%%%%%%%%%%%%%%%%%%%%%%
a=figure('Units','Normalized','Color',[0.513725 0.6 0.694118], ...
'Name','Setting','NumberTitle','off',...
'Position',[0.085 0.065 0.85 0.8],'MenuBar','None', ...
'Resize','on','Visible','Off','Tag','Fig1');
%Label: "OUTPUT OPTIONS"
uicontrol('Parent',a,'Units','normalized','Tag','StaticText10',...
'HorizontalAlignment','left',...
'BackgroundColor',[0.513725 0.6 0.694118],'String','OUTPUT OPTIONS',...
'FontSize', FontSize,'FontWeight','bold','Style','text',...
'Position',[0.05 0.9 0.3 0.04]);
%Check box for "Output File"
opChk=uicontrol('Parent',a,'Units','normalized','Tag','Checkbox1', ...
'HorizontalAlignment','left',...
'BackgroundColor',[0.513725 0.6 0.694118],'FontSize', FontSize, ...
'Position',[0.05 0.84 0.15 0.0527859],...
'String','Output File :','Style','checkbox','Value',DATA(1));
%Edit box for "Output File"
opEdt=uicontrol('Parent',a,'Units','normalized','Tag','EditText8',...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1],'Style','edit', ...
'Position',[0.2 0.84 0.234 0.0557185],'FontSize', FontSize,'String',OutputFile);
%Label: "Precision"
uicontrol('Parent',a,'Units','normalized', ...
'BackgroundColor',[0.513725 0.6 0.694118], ...
'FontSize', FontSize,'Position',[0.28 0.78 0.12 0.04], ...
'String','Precision','Style','text','Tag','StaticText11');
%Check box for "Lyapunov Exponents"
leChk=uicontrol('Parent',a,'Units','normalized', ...
'BackgroundColor',[0.513725 0.6 0.694118],'Tag','Checkbox2', ...
'HorizontalAlignment','left',...
'FontSize', FontSize,'Position',[0.05 0.71261 0.226415 0.058651], ...
'String','Lyapunov Exponents','Style','checkbox','Value',DATA(2));
%Check box for "Lyapunov Dimension"
ldChk=uicontrol('Parent',a,'Units','normalized','Tag','Checkbox3', ...
'BackgroundColor',[0.513725 0.6 0.694118],'FontSize', FontSize, ...
'HorizontalAlignment','left',...
'Position',[0.05 0.648094 0.226415 0.058651], ...
'String','Lyapunov Dimension','Style','checkbox','Value',DATA(4));
%Pop-up menu for precision of "Lyapunov Exponents"
lePop=uicontrol('Parent',a,'Units','normalized', ...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...
'Position',[0.285 0.715543 0.115 0.058651],'FontSize', FontSize, ...
'String',char('%.4f','%.6f','%.8f','%.10f','%.12f'), ...
'Style','popupmenu','Tag','PopupMenu2','Value',DATA(3));
%Pop-up menu for precision of Lyapunov dimension
ldPop=uicontrol('Parent',a,'Units','normalized', ...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...
'Position',[0.285 0.65 0.115 0.058],'FontSize', FontSize, ...
'String',char('%.4f','%.6f','%.8f','%.10f','%.12f'), ...
'Style','popupmenu','Tag','PopupMenu3','Value',DATA(5));
%Label: "INTEGRATION PARAMETERS"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'FontWeight','bold',...
'HorizontalAlignment','left',...
'Position',[0.05 0.557185 0.333962 0.04],'Style','text',...
'String','INTEGRATION PARAMETERS','Tag','StaticText1');
%Label: "ODE Function"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'Position',[0.05 0.5 0.15 0.04],...
'String','ODE Function :','Tag','StaticText2');
%Label: "Integration Method"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize, ...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'Position',[0.05 0.44 0.186 0.04],...
'HorizontalAlignment','left',...
'String','Integration Method :','Tag','StaticText3');
%Label: "Initial Time"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'Position',[0.05 0.377 0.115 0.04], ...
'String','Initial Time :','Tag','StaticText4');
%Label: "Final Time"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'Position',[0.05 0.32 0.113 0.04], ...
'String','Final Time :','Tag','StaticText5');
%Label "Time Step"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'Position',[0.05 0.27 0.11 0.04], ...
'String','Time Step :','Tag','StaticText6');
%Label: "Relative Tolerance"
uicontrol('Parent',a,'Style','text','Units','normalized','FontSize', FontSize, ...
'HorizontalAlignment','left',...
'BackgroundColor',[0.513725 0.6 0.694118],'String','Relative Tolerance :', ...
'Position',[0.05 0.21 0.18 0.04],'Tag','StaticText7');
%Label: "Absolution Tolerance"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'String','Absolute Tolerance :','Tag','StaticText8',...
'Position',[0.05 0.154 0.18 0.04]);
%Label: "Initial Conditions"
uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...
'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...
'HorizontalAlignment','left',...
'Position',[0.05 0.095 0.18 0.04],...
'String','Initial Condition(s) :','Tag','StaticText9');
%Edit box for "ODE Function"
odeEdt=uicontrol('Parent',a,'Units','normalized','Style','edit',...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1],'Tag','EditText2', ...
'Position',[0.2 0.5 0.2 0.055],'FontSize', FontSize,'String',odeFunction);
%Edit box for "Final Time"
ftEdt=uicontrol('Parent',a,'Units','normalized','Tag','EditText4','FontSize', FontSize, ...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1],'Style','edit',...
'Position',[0.166 0.325513 0.234 0.05],'String',num2str(DATA(8)));
%Edit box for "Time Step"
tsEdt=uicontrol('Parent',a,'Units','normalized','Tag','EditText5','FontSize', FontSize, ...
'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1],'Style','edit', ...
'Position',[0.166 0.272727 0.234 0.05],'String',num2str(DATA(9)));
%Edit box for "Relative Tolerance"
rtolEdt=uicontrol('Parent',a,'Units','norma