⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setting.m

📁 matlab let工具箱
💻 M
📖 第 1 页 / 共 3 页
字号:
   Foreground=Fore(c);   colorPop=uicontrol('Parent',a,'Units','normalized','Style','popupmenu',...        'BackgroundColor',Background,'ForegroundColor',Foreground,'FontSize', FontSize,...        'Position',[0.64 0.656891 0.125 0.0527859],'Value',DATA(15),...        'String',char('Blue','Black','Green','Red','Yellow','Magenta','Cyan'), ...        'Tag','PopupMenu4','Callback','setting(''ChangeColor'')');   %Label: "X-Axis Label"   uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...        'BackgroundColor',[0.513725 0.6 0.694118], ...        'HorizontalAlignment','left',...           'Position',[0.5 0.565 0.134 0.0469208], ...        'String','X-Axis Label :','Style','text','Tag','StaticText17');   %Lable: "Y-Axis Label"   uicontrol('Parent',a,'Units','normalized', ...        'HorizontalAlignment','left',...           'BackgroundColor',[0.513725 0.6 0.694118], ...        'FontSize', FontSize,'Position',[0.5 0.5 0.134 0.0498534], ...        'String','Y-Axis Label :','Style','text','Tag','StaticText18');   %Edit box for "X-Axis Label"   xlabel=get(get(AxesHandle,'xlabel'),'String');   xlabelEdt=uicontrol('Parent',a,'Units','normalized',...        'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...        'Position',[0.64 0.571848 0.35 0.058651],'FontSize', FontSize, ...        'String',xlabel,'Style','edit','Tag','EditText10');   %Edit box for "Y-Axis Label"   ylabel=get(get(AxesHandle,'ylabel'),'String');   ylabelEdt=uicontrol('Parent',a,'Units','normalized', ...        'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...        'Position',[0.64 0.510264 0.35 0.058651],'FontSize', FontSize, ...        'String',ylabel,'Style','edit','Tag','EditText11');   %Label: "Title"   uicontrol('Parent',a,'Units','normalized', ...        'BackgroundColor',[0.513725 0.6 0.694118], ...        'HorizontalAlignment','left',...           'FontSize', FontSize,'Position',[0.5 0.425 0.0641509 0.05], ...        'String','Title :','Style','text','Tag','StaticText19');   %Edit box for "Title"	Title=get(get(AxesHandle,'title'),'String');	titleEdt=uicontrol('Parent',a,'Units','normalized','FontSize', FontSize, ...        'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...        'Position',[0.57 0.435 0.42 0.058651], ...        'Style','edit','String',Title,'Tag','EditText12');   %Label: "ITERATION PARAMETERS"   uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...        'BackgroundColor',[0.513725 0.6 0.694118],'FontWeight','bold',...        'HorizontalAlignment','left',...           'Position',[0.5 0.34 0.3 0.0469208],'Style','text',...        'String','ITERATION PARAMETERS','Tag','StaticText13');  %Label: "No. of transient iterations to be discarded ..."   Str=['No. of transient iterations to be', sprintf('\n'),...        'discarded before calculation :'];   uicontrol('Parent',a,'Units','normalized', ...        'BackgroundColor',[0.513725 0.6 0.694118], ...        'HorizontalAlignment','left',...           'FontSize', FontSize,'Position',[0.5 0.24 0.3 0.08], ...        'String',Str,'Style','text','Tag','StaticText20');   %Edit box for "No. of transient iterations to be discarded ..."   discardEdt=uicontrol('Parent',a,'Units','normalized', ...        'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...        'Position',[0.8 0.265 0.12 0.05],'FontSize', FontSize, ...        'String',num2str(DATA(16)),'Style','edit','Tag','EditText13');   %Label: "Update the Lyapunov exponents every"   pos=[0.5 0.16 0.2 0.08];   Str=['Update the Lyapunov',sprintf('\n'), 'exponent(s) every '];   uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...        'HorizontalAlignment','left',...           'BackgroundColor',[0.513725 0.6 0.694118],'Style','text',...        'Position',pos,'Tag','StaticText14','String',Str);   %Edit box for updating step   pos=[0.72 0.185 0.12 0.05];   upEdt=uicontrol('Parent',a,'Units','normalized','Tag','EditText9','FontSize', FontSize, ...        'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1],'Style','edit',...        'Position',pos,'String',num2str(DATA(17)));   %Label: "time step(s)"   pos=[0.86 0.175 0.12 0.05];   uicontrol('Parent',a,'Units','normalized','Tag','StaticText15',...        'HorizontalAlignment','left',...           'BackgroundColor',[0.513725 0.6 0.694118],'Style','text', ...        'FontSize', FontSize,'Position',pos,'String','time step(s)');   %Label: "No. of linearized ODEs "   uicontrol('Parent',a,'Units','normalized','Tag','StaticText21',...       'BackgroundColor',[0.513725 0.6 0.694118], ...       'HorizontalAlignment','left',...          'FontSize', FontSize,'Position',[0.05 0.015 0.23 0.05], ...       'String','No. of linearized ODEs :','Style','text');   %Edit box for "No. of linearized"   if length(DATA)>=18      linStr=num2str(DATA(18));   else      linStr='';   end   linEdt=uicontrol('Parent',a,'Units','normalized', ...      'BackgroundColor',[1 1 1],'ForegroundColor',[0 0 1], ...      'Position',[0.3 0.03 0.1 0.05],'FontSize', FontSize, ...      'Style','edit','String',linStr,'Tag','EditText14');   %"OK" pushbutton   okBtn=uicontrol('Parent',a,'Units','normalized', ...        'FontSize', FontSize,'FontWeight','bold','Position',[0.5 0.02 0.1 0.065],'String','OK',...        'CallBack','setting(''checking'')','Tag','Pushbutton1');   %"Help" pushbutton   cancelBtn=uicontrol('Parent',a,'Units','normalized', ...        'FontSize', FontSize,'FontWeight','bold','String','Cancel',...        'Position',[0.65 0.02 0.1 0.065],'Callback','close(gcf)','Tag','Pushbutton2');   %"Help" pushbutton   helpBtn=uicontrol('Parent',a,'Units','normalized','FontSize', FontSize,...        'FontWeight','bold','String','Help','Position',[0.8 0.02 0.1 0.065],...        'Callback','setting(''help'')','Tag','Pushbutton3');   %If "Integration method" is "discrete map", fix the time step to 1    %and initial time to 0, disable the "Absolute Tolerance" and    %"Relative Tolerance" edit boxes   IntMethod=DATA(6);   if IntMethod==1      set(tsEdt,'String','1','Enable','off');      set(itEdt,'String','0','Enable','off');      set([atolEdt,rtolEdt],'String','0','Enable','off');   end      %Store the handles of the main window in 'UserData' of    %the "OK" button in the setting window   set(okBtn,'UserData',MainHandles);   %Store all the handles of the setting window in 'UserData' of the window   HandlesList=[opChk, opEdt, leChk, ldChk, lePop,...               ldPop, odeEdt, ftEdt, tsEdt, rtolEdt,...               atolEdt, intPop, itEdt, icEdt, PlotImedRadio,...               PlotStepRadio, PlotStepEdt, upEdt, colorPop, xlabelEdt,...               ylabelEdt, titleEdt, discardEdt, okBtn, cancelBtn,...               helpBtn, linEdt];   set(a,'UserData',HandlesList,'Visible','On');   %Do not show any axis on the setting window   set(gca,'visible','Off');case {1,2}   %One of the radio buttons was chosen   %Uncheck the other one radio button   %HandlesList(15) is the handle of radio button 1   %HandlesList(16) is the handle of radio button 2   if action==1      %Radio button 1: "Update plot imediately" was chosen      check(HandlesList(15),HandlesList(16));   else      %Radio button 2: "Update plot every ... iterations" was chosen      check(HandlesList(16),HandlesList(15));   endcase 'changecolor'   %HandlesList(19) is the handle of "Line Color" pop-up menu   c=get(HandlesList(19),'Value');   %Look-up tables for background and foreground colors   Back='bkgrymc';	Fore='wwkwkwk';   set(HandlesList(19),'BackgroundColor',Back(c),'ForegroundColor',Fore(c));case 'changemethod'   %HandlesList(12) is the handle of "Integration Method" pop-up menu   %HandlesList(9) is the handle of "Time Step" edit box   %HandlesList(13) is the handle of "Initial Time" edit box   %HandlesList(10) is the handle of "Relative Tolerance" edit box   %HandlesList(11) is the handle of "Absolute Tolerance" edit box   IntMethod=get(HandlesList(12),'Value');   %If the user select "Discrete map", set the time step to 1 and initial time   %to 0, and don't allow the user to change them.   if IntMethod==1      set(HandlesList(9),'String','1','Enable','off');      set(HandlesList(13),'String','0','Enable','off');      set([HandlesList(10),HandlesList(11)],'String','0','Enable','off');   else      set(HandlesList(9),'Enable','on');      set(HandlesList(13),'Enable','on');      set([HandlesList(10),HandlesList(11)],'String','1e-5','Enable','on');   endcase 'checking'   %Get the data input by the user and   %then check the data   checking(HandlesList);case 'help'   helpwin('sethelp','Setting Help Window');otherwise   error('Invalid switch!');end%------------------Subroutines----------------------------function checking(HandlesList)%CHECKING    Checks data input by the user and%            stores the data if no erors are found.%Get the data input by the userOutputFile=get(HandlesList(2),'String');	%output filexLabel=get(HandlesList(20),'String');		%X-Axis labelyLabel=get(HandlesList(21),'String');		%Y-Axis labelTitle=get(HandlesList(22),'String');		%Titleoutput=get(HandlesList(1),'Value');             %Output checkbox: on/offLEout=get(HandlesList(3),'Value');              %Checkbox: "Lyapunov Exponents"LDout=get(HandlesList(4),'Value');              %Checkbox: "Lyapunov Dimension"LEprecision=get(HandlesList(5),'Value');	%Precision of LEsLDprecision=get(HandlesList(6),'Value');        %Precsion of Lyapunov DimensionODEfunction=get(HandlesList(7),'String');	%ODE functionIntMethod=get(HandlesList(12),'Value');         %Integration methodInitialTime=str2num(get(HandlesList(13),'String'));	%Initial timeFinalTime=str2num(get(HandlesList(8),'String'));	%Final timeTimeStep=str2num(get(HandlesList(9),'String'));		%Time stepRelTol=str2num(get(HandlesList(10),'String'));		%Relative toleranceAbsTol=str2num(get(HandlesList(11),'String'));		%Absolute toleranceic=str2num(get(HandlesList(14),'String'));              %Initial coniditionslinODEnum=str2num(get(HandlesList(27),'String'));       %No. of linearized ODEs    %PLOTTING OPTIONS: 	plot1=get(HandlesList(15),'Value');             %Plot imediatelyplot2=get(HandlesList(16),'Value');             %Update the plot every ... iterationsItrNum=str2num(get(HandlesList(17),'string'));	%Update every   ItrNum  iterations  %Line ColorsLineColor=get(HandlesList(19),'Value');		%Line color   %Transient iterations to be discardedDiscard=str2num(get(HandlesList(23),'String'));	%Steps for updating the LEsUpdateStep=str2num(get(HandlesList(18),'String'));%One iterationIteration=UpdateStep*TimeStep;%Min. time for one iterationminT=Iteration*(Discard+1);%Total number of iterationsTotalItr=fix(FinalTime/Iteration);%Max. buffer size for storing the plotting data (10000 data)buffersize=10000;N=TotalItr-Discard;  maxItr=min(N,buffersize);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -