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

📄 poincare_section.m

📁 主成分分析和偏最小二乘SquaresPrincipal成分分析( PCA )和偏最小二乘( PLS )
💻 M
📖 第 1 页 / 共 2 页
字号:
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in x.
function x_Callback(hObject, eventdata, handles)
% hObject    handle to x (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

set([handles.x handles.f handles.init],'value',get(hObject,'Value'));

% --- Executes during object creation, after setting all properties.
function f_CreateFcn(hObject, eventdata, handles)
% hObject    handle to f (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes during object creation, after setting all properties.
function init_CreateFcn(hObject, eventdata, handles)
% hObject    handle to init (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on button press in add.
function add_Callback(hObject, eventdata, handles)
% hObject    handle to add (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

N=length(get(handles.x,'string'));
x={};
for i=1:N
    x{i}=['dx' num2str(i) '/dt'];
end
set(handles.x,'string',x);
prompt = {['Enter equation dx'  num2str(N+1) '/dt=...'],...
        'Enter initial condition:'};
dlg_title = 'Add new equation';
num_lines= 1;
def     = {'','0.5'};
answer  = inputdlg(prompt,dlg_title,num_lines,def);
if ~isempty(answer)
    x=get(handles.x,'string');
    f=get(handles.f,'string');
    init=get(handles.init,'string');
    x{N+1}=['dx' num2str(N+1) '/dt'];
    f{N+1}=answer{1};
    init{N+1}=answer{2};
    set([handles.x, handles.f, handles.init],'value',N+1);
    set(handles.x,'string',x);
    set(handles.f,'string',f);
    set(handles.init,'string',init);
end
if length(get(handles.x,'string'))~=3
    set(handles.ok,'enable','off');
else
    set(handles.ok,'enable','on');
end
    


% --- Executes on button press in modify.
function modify_Callback(hObject, eventdata, handles)
% hObject    handle to modify (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

x=get(handles.x,'string');
f=get(handles.f,'string');
init=get(handles.init,'string');
selection=get(handles.x,'value');
if isempty(x)
    x{1}='dx1/dt'; f{1}=''; init{1}='0.7';
end

prompt = {['Enter equation '  x{selection} '=...'],...
        'Enter initial condition:'};
dlg_title = 'Modify equation';
num_lines= 1;
def     = {f{selection},init{selection}};
answer  = inputdlg(prompt,dlg_title,num_lines,def);
if ~isempty(answer)
    f{selection}=answer{1};
    init{selection}=answer{2};
    set(handles.x,'string',x);
    set(handles.f,'string',f);
    set(handles.init,'string',init);
end
if length(get(handles.x,'string'))~=3
    set(handles.ok,'enable','off');
else
    set(handles.ok,'enable','on');
end

% --- Executes on button press in delete.
function delete_Callback(hObject, eventdata, handles)
% hObject    handle to delete (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

x=get(handles.x,'string');
f=get(handles.f,'string');
init=get(handles.init,'string');
selection=get(handles.x,'value');
if isempty(x)
    return
end

n_f={}; n_init={}; n_x={};
k=1;
for i=1:length(x)
    if i~=selection
        n_f{k}=f{i};
        n_init{k}=init{i};
        n_x{k}=x{i};
        k=k+1;
    end
end
set([handles.x, handles.f, handles.init],'value',max([1 selection-1]));
    
set(handles.x,'string',n_x);
set(handles.f,'string',n_f);
set(handles.init,'string',n_init);

if length(get(handles.x,'string'))~=3
    set(handles.ok,'enable','off');
else
    set(handles.ok,'enable','on');
end

N=length(get(handles.x,'string'));
x={};
for i=1:N
    x{i}=['dx' num2str(i) '/dt'];
end
set(handles.x,'string',x);


% --- Executes during object creation, after setting all properties.
function solver_CreateFcn(hObject, eventdata, handles)
% hObject    handle to solver (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
set(hObject,'string',{'ode45' 'ode23' 'ode113' 'ode15s' 'ode23s' 'ode23t' 'ode23tb'});

% --- Executes on selection change in solver.
function solver_Callback(hObject, eventdata, handles)
% hObject    handle to solver (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: contents = get(hObject,'String') returns solver contents as cell array
%        contents{get(hObject,'Value')} returns selected item from solver


% --- Executes during object creation, after setting all properties.
function addit_param_CreateFcn(hObject, eventdata, handles)
% hObject    handle to addit_param (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function addit_param_Callback(hObject, eventdata, handles)
% hObject    handle to addit_param (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of addit_param as text
%        str2double(get(hObject,'String')) returns contents of addit_param as a double


% --- Executes during object creation, after setting all properties.
function tr_time_CreateFcn(hObject, eventdata, handles)
% hObject    handle to tr_time (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function tr_time_Callback(hObject, eventdata, handles)
% hObject    handle to tr_time (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of tr_time as text
%        str2double(get(hObject,'String')) returns contents of tr_time as a double


% --- Executes during object creation, after setting all properties.
function e_C1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to e_C1 (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function e_C1_Callback(hObject, eventdata, handles)
% hObject    handle to e_C1 (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of e_C1 as text
%        str2double(get(hObject,'String')) returns contents of e_C1 as a double


% --- Executes during object creation, after setting all properties.
function e_C2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to e_C2 (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function e_C2_Callback(hObject, eventdata, handles)
% hObject    handle to e_C2 (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of e_C2 as text
%        str2double(get(hObject,'String')) returns contents of e_C2 as a double


% --- Executes during object creation, after setting all properties.
function e_C3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to e_C3 (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function e_C3_Callback(hObject, eventdata, handles)
% hObject    handle to e_C3 (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of e_C3 as text
%        str2double(get(hObject,'String')) returns contents of e_C3 as a double


% --- Executes during object creation, after setting all properties.
function e_C_CreateFcn(hObject, eventdata, handles)
% hObject    handle to e_C (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function e_C_Callback(hObject, eventdata, handles)
% hObject    handle to e_C (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of e_C as text
%        str2double(get(hObject,'String')) returns contents of e_C as a double


% --- Executes during object creation, after setting all properties.
function e_E_CreateFcn(hObject, eventdata, handles)
% hObject    handle to e_E (see GCBO)
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function e_E_Callback(hObject, eventdata, handles)
% hObject    handle to e_E (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of e_E as text
%        str2double(get(hObject,'String')) returns contents of e_E as a double


% --- Executes on button press in r_mp.
function r_mp_Callback(hObject, eventdata, handles)
% hObject    handle to r_mp (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of r_mp
set(handles.r_mp,'value',1);
set([handles.r_pm handles.r_b],'value',0);


% --- Executes on button press in r_pm.
function r_pm_Callback(hObject, eventdata, handles)
% hObject    handle to r_pm (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of r_pm
set(handles.r_pm,'value',1);
set([handles.r_mp handles.r_b],'value',0);


% --- Executes on button press in r_b.
function r_b_Callback(hObject, eventdata, handles)
% hObject    handle to r_b (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of r_b
set(handles.r_b,'value',1);
set([handles.r_pm handles.r_mp],'value',0);


% --- Executes on button press in plot.
function plot_Callback(hObject, eventdata, handles)
% hObject    handle to plot (see GCBO)
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of plot


⌨️ 快捷键说明

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