📄 abc_pp.m
字号:
function abc_pp(op);
% Adventures in Bifurication & Chaos Tool using Matlab - The Chua Circuit Paradigm
% Variables available to all functions - Unlimited scope
global H_ABC_pp F_ABC_pp G_ABC_pp A_ABC_pp P_ABC_PP Timeseries Points
% What happens here? Basically when the m file is run without an
% argument (if nargin == 0), we decide that it is been run for the first
% time and draw the GUI (figure with ui components).
%
% On subsequent uicomponent callbacks (when a button is pressed etc), we run the code
% associated with that uicomponent, this code is partitioned within the
% switch loop! James McEvoy
% If no input argument, draw the GUI
if nargin == 0
op = 0;
end
% Switch Loop, Controls GUI in an Event_Driven fashion -> Callbacks!!
switch op
% Draw figure :: Case 0 just sets up the GUI aesthetics, go to Case 1 to see the science bit!
case 0
% Erase any previously recorded data
clear global data
% Background Color
back_clr = [0.7529 0.7929 0.97];%[0.4529 0.431759929 0.74508716517];
% Figure
F_ABC_pp = figure('Color',back_clr, ...
'MenuBar','none', ...
'Name','ABC++', ...
'NumberTitle','off', ...
'Units','normalized', ...
'Position',[.005 .039 .99 .93], ...
'CloseRequestFcn','abc_pp(3)',...
'RendererMode','manual', ...
'Renderer','painters', ...
'Resize','off', ...
'ToolBar','none', ...
'Visible','off');
% AXES
G_ABC_pp(1) = axes('Parent',F_ABC_pp,'Units','normalized',...% Main Stage
'XColor',[1 0 0],'YColor',[0 1 0],'ZColor',[0 0 1],... % Color x,y & z axes
'Position',[0.049 0.065 0.5286 0.6096]);
G_ABC_pp(3) = axes('Parent',F_ABC_pp,'Units','normalized',...% Time Series Stage
'Color',[1 1 1],'Position',[0.049 0.7596 0.5286 0.15]);
G_ABC_pp(4) = axes('Parent',F_ABC_pp,'Units','normalized',...
'Color',[1 1 1],'CameraUpVector',[0 1 0],...
'Position',[0.6296 0.7096 0.3586 0.2096],...
'XColor',[0 0 0],'YColor',[0 0 0],'ZColor',[0 0 0]...
);
% Read in chua image and place it axes 4
warning off all % Suppress Warning
axes(G_ABC_pp(4));
imagen=imread('etc\chua.png');
image(imagen);
axis off;
warning on all % Turn back on warnings
% UI Components
H_ABC_pp(1) = uicontrol('Parent',F_ABC_pp,'Style','pushbutton',... % File Open Button
'Units','normalized',...
'Position',[0.00195 0.966 0.0586 0.03125],...
'ForegroundColor',[0 0 0],...
'FontWeight','bold',...
'String','File Open',...
'Visible','on',...
'CallBack','abc_pp(1)'); %Execute Switch Case 1 if pressed
H_ABC_pp(27) = uicontrol('Parent',F_ABC_pp,'Style','pushbutton',... % File Save Button
'Units','normalized',...
'Position',[0.0635 0.966 0.0586 0.03125],...
'ForegroundColor',[0 0 0],...
'FontWeight','bold',...
'String','File Save',...
'Visible','on',...
'CallBack','abc_pp(8)'); %Execute Switch Case 8 if pressed
H_ABC_pp(2) = uicontrol('Parent',F_ABC_pp,'Style','pushbutton',... % Info Button
'Units','normalized','Position',[0.202 0.966 0.0586 0.03125],...
'ForegroundColor',[0 0 0],...
'FontWeight','bold',...
'String','Info',...
'Visible','on',...
'CallBack','abc_pp(2)'); %Execute Switch Case 2 if pressed
H_ABC_pp(3) = uicontrol('Parent',F_ABC_pp,'Style','pushbutton',... % Close Button
'Units','normalized','Position',[0.263 0.966 0.0586 0.03125],...
'ForegroundColor',[0 0 0],...
'FontWeight','bold',...
'String','Close',...
'Visible','on',...
'CallBack','abc_pp(3)'); %Execute Switch Case 3 if pressed
H_ABC_pp(6) = uicontrol('Parent',F_ABC_pp,'Style','pushbutton',... % Save Figure Button
'Units','normalized','Position',[0.125 0.966 0.074 0.03125],...
'ForegroundColor',[0 0 0],...
'FontWeight','bold',...
'String','Save Figure',...
'Visible','on',...
'CallBack','abc_pp(6)'); %Execute Switch Case 3 if pressed
H_ABC_pp(4) = uicontrol('Style','slider','Min',0,'Max',360,... % Slider
'Units','normalized','Position',[0.039 0.003 0.54 0.024],...
'SliderStep',[0.01 0.1],...
'Visible','on',...
'CallBack','abc_pp(4)'); %Execute Switch Case 5 if pressed
H_ABC_pp(5) = uicontrol('Style','slider','Min',0,'Max',360,... % Slider
'Units','normalized','Position',[0.003 0.065 0.018 0.6096],...
'SliderStep',[0.01 0.1],...
'Visible','on',...
'CallBack','abc_pp(5)'); %Execute Switch Case 5 if pressed
% UI Aesthetics
A_ABC_pp(1) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Chua Parameters etc)
'Units','normalized','Position',[0.6296 0.5 0.3586 0.21],'Style','frame');
A_ABC_pp(2) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Circuit Parameters)
'Units','normalized','Position',[0.6296 0.9192 0.2 0.026],'Style','frame');
A_ABC_pp(55) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Eigen Values)
'Units','normalized','Position',[0.6296 0.46 0.2 0.026],'Style','frame');
A_ABC_pp(57) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Eigen Values 2)
'Units','normalized','Position',[0.6296 0.293 0.3586 0.168],'Style','frame');
A_ABC_pp(3) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Phase-Space)
'Units','normalized','Position',[0.03199 0.693 0.4 0.028],'Style','frame');
A_ABC_pp(41) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Frame (Timeseries)
'Units','normalized','Position',[0.03199 0.92 0.45 0.029],'Style','frame');
A_ABC_pp(42) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Text
'FontName','Helvetica','HorizontalAlignment','left','FontWeight','bold','FontSize',10,'ForegroundColor',[0 0 0],...
'Units','normalized','Position',[0.04199 0.926 0.0953 0.02],'String','TimeSeries ->','Style','text');
A_ABC_pp(56) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Text
'FontName','Helvetica','HorizontalAlignment','left',...
'FontSize',10,'FontWeight','bold','ForegroundColor',[0 0 0],...
'Units','normalized','Position',[0.635 0.461 0.18 0.024],'String','Eigen Values :-','Style','text');
A_ABC_pp(58) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Text
'FontName','Helvetica','HorizontalAlignment','left',...
'FontSize',10,'ForegroundColor',[0 0 0],...
'Units','normalized','Position',[0.635 0.431 0.1 0.024],'String','Inner Region :-','Style','text');
A_ABC_pp(65) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Text
'FontName','Helvetica','HorizontalAlignment','left',...
'FontSize',10,'ForegroundColor',[0 0 0],...
'Units','normalized','Position',[0.75 0.431 0.07 0.024],'String','(Real)','Style','text');
A_ABC_pp(69) = uicontrol('Parent',F_ABC_pp,'BackgroundColor',[1 1 1],...% Text
'FontName','Helvetica','HorizontalAlignment','right',...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -