📄 lrd2007.m
字号:
function varargout = LRd2007(varargin)
% LRD2007 M-file for LRd2007.fig
% LRD2007, by itself, creates a new LRD2007 or raises the existing
% singleton*.
%
% H = LRD2007 returns the handle to a new LRD2007 or the handle to
% the existing singleton*.
%
% LRD2007('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in LRD2007.M with the given input arguments.
%
% LRD2007('Property','Value',...) creates a new LRD2007 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before LRd2007_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to LRd2007_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help LRd2007
% Last Modified by GUIDE v2.5 14-Nov-2007 05:33:21
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @LRd2007_OpeningFcn, ...
'gui_OutputFcn', @LRd2007_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin & isstr(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before LRd2007 is made visible.
function LRd2007_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to LRd2007 (see VARARGIN)
% Choose default command line output for LRd2007
handles.output = hObject;
% INITIAL DATA
bcl=0.400;
freq=1;
k_o=4.5;
na_o=140;
ca_o=1.8;
G_gap=0;
LastBCL=0.400;
set(handles.editLastBCL,'String',num2str(LastBCL));
handles.LastBCL =LastBCL;
% % bcl=get(handles.sliderBCL, 'value');;
set(handles.editBCL,'String',num2str(bcl));
set(handles.sliderBCL,'Value', bcl);
%freq = get(handles.sliderFreq,'value');
set(handles.editFreq,'String',num2str(round(freq)));
set(handles.sliderFreq,'Value',freq);
%k_o = get(handles.sliderKo,'value') ;
set(handles.sliderKo,'Value',k_o) ;
set(handles.editKo,'String',num2str(k_o));
%na_o = get(handles.sliderSodium,'value') ;
set(handles.sliderSodium,'Value',na_o)
set(handles.editSodium,'String',num2str(na_o));
set(handles.sliderCalcium,'Value',ca_o)
set(handles.editCalcium,'String',num2str(ca_o));
handles.freq=freq;
handles.bcl=bcl;
handles.k_o=k_o;
handles.ca_o=ca_o;
handles.v=0;
handles.na_o=na_o;
handles.G_gap=G_gap;
handles.LastBCL=LastBCL;
% splash('logo2.jpg','jpeg')
% Update handles structure
% set(hObject, 'Units', 'pixels');
% handles.banner = imread(['Slide2.jpg']); % Read the image file banner.jpg
% info = imfinfo(['Slide2.jpg']); % Determine the size of the image file
% position = get(hObject, 'Position');
% set(hObject, 'Position', [position(1:2) info.Width + 100 info.Height + 100]);
% axes(handles.axes1);
% image(handles.banner)
% set(handles.axes1, ...
% 'Visible', 'off', ...
% 'Units', 'pixels', ...
% 'Position', [50 50 info.Width info.Height]);
axes(handles.axes1); a= (imread('logoCBAClong.jpg'));
image(a);
set(handles.axes1,'Visible', 'off')
guidata(hObject, handles);
axes(handles.axes2)
text(0.1 ,0.5,'Choose parameters and \newline press Start to proceed','FontSize',20,'FontWeight','bold')
set(handles.axes2,'Visible', 'off')
% UIWAIT makes LRd2007 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
set(handles.axes3,'Visible', 'off')
% --- Outputs from this function are returned to the command line.
function varargout = LRd2007_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes during object creation, after setting all properties.
function sliderBCL_CreateFcn(hObject, eventdata, handles)
% hObject handle to sliderBCL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on slider movement.
function sliderBCL_Callback(hObject, eventdata, handles)
% hObject handle to sliderBCL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
bcl=get(handles.sliderBCL, 'value');;
set(handles.editBCL,'String',num2str(round(bcl)));
handles.bcl=bcl;
% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function sliderFreq_CreateFcn(hObject, eventdata, handles)
% hObject handle to sliderFreq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on slider movement.
function sliderFreq_Callback(hObject, eventdata, handles)
% hObject handle to sliderFreq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
freq = get(handles.sliderFreq,'value');
set(handles.editFreq,'String',num2str(round(freq)));
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles.freq=freq;
% Update handles structure
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function sliderKo_CreateFcn(hObject, eventdata, handles)
% hObject handle to sliderKo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background, change
% 'usewhitebg' to 0 to use default. See ISPC and COMPUTER.
usewhitebg = 1;
if usewhitebg
set(hObject,'BackgroundColor',[.9 .9 .9]);
else
set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end
% --- Executes on slider movement.
function sliderKo_Callback(hObject, eventdata, handles)
% hObject handle to sliderKo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
k_o = get(handles.sliderKo,'value') ;
set(handles.editKo,'String',num2str(k_o));
handles.k_o=k_o;
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%The callback for the Ki Current value follows a similar approach.
data.freq=round(handles.freq);
data.bcl=1000*handles.bcl;
data.k_o=handles.k_o;
data.ca_o=handles.ca_o;
data.na_o=handles.na_o;
data.G_gap=handles.G_gap/20;
data.LastBCL=1000*handles.LastBCL ;
[currents,State,t]=mainLRd_web2007(data);
d=Import(State,currents,t,handles);
%guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function editBCL_CreateFcn(hObject, eventdata, handles)
% hObject handle to editBCL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% 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 editBCL_Callback(hObject, eventdata, handles)
% hObject handle to editBCL (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of editBCL as text
% str2double(get(hObject,'String')) returns contents of editBCL as a double
bcl = str2double(get(handles.editBCL,'String'));
if bcl >= get(handles.sliderBCL,'Min') & ...
bcl <= get(handles.sliderBCL,'Max')
set(handles.sliderBCL,'Value',bcl);
elseif bcl > get(handles.sliderBCL,'Max')
set(handles.sliderBCL,'Value',get(handles.sliderBCL,'Max'));
set(handles.editBCL,'String',num2str(get(handles.sliderBCL,'Max')))
elseif bcl < get(handles.sliderBCL,'Min')
set(handles.sliderBCL,'Value',get(handles.sliderBCL,'Min'));
set(handles.editBCL,'String',num2str(get(handles.sliderBCL,'Min')))
else
set(handles.sliderBCL,'Value',get(handles.sliderBCL,'Min'));
set(handles.editBCL,'String',num2str(get(handles.sliderBCL,'Min')))
end
handles.bcl=bcl;
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function editFreq_CreateFcn(hObject, eventdata, handles)
% hObject handle to editFreq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% 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 editFreq_Callback(hObject, eventdata, handles)
% hObject handle to editFreq (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of editFreq as text
% str2double(get(hObject,'String')) returns contents of editFreq as a double
freq = str2double(get(handles.editFreq,'String'));
if freq >= get(handles.sliderFreq,'Min') & ...
freq <= get(handles.sliderFreq,'Max')
set(handles.sliderFreq,'Value',freq);
elseif freq >get(handles.sliderFreq,'Max')
set(handles.sliderFreq,'Value',get(handles.sliderFreq,'Max'));
set(handles.editFreq,'String',num2str(get(handles.sliderFreq,'Max')))
elseif freq < get(handles.sliderFreq,'Min')
set(handles.sliderFreq,'Value',get(handles.sliderFreq,'Min'));
set(handles.editFreq,'String',num2str(get(handles.sliderFreq,'Min')))
else
set(handles.sliderFreq,'Value',get(handles.sliderFreq,'Min'));
set(handles.editFreq,'String',num2str(get(handles.sliderFreq,'Min')))
end
handles.freq=freq;
guidata(hObject, handles);
% --- Executes during object creation, after setting all properties.
function editKo_CreateFcn(hObject, eventdata, handles)
% hObject handle to editKo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% 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 editKo_Callback(hObject, eventdata, handles)
% hObject handle to editKo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of editKo as text
% str2double(get(hObject,'String')) returns contents of editKo as a double
k_o = str2double(get(handles.editKo,'String'));
if k_o >= get(handles.sliderKo,'Min') & ...
k_o <= get(handles.sliderKo,'Max')
set(handles.sliderKo,'Value',k_o);
elseif k_o > get(handles.sliderKo,'Max')
set(handles.sliderKo,'Value',get(handles.sliderKo,'Max'));
set(handles.editKo,'String',num2str(get(handles.sliderKo,'Max')))
elseif k_o < get(handles.sliderKo,'Min')
set(handles.sliderKo,'Value',get(handles.sliderKo,'Min'));
set(handles.editKo,'String',num2str(get(handles.sliderKo,'Min')))
else
set(handles.sliderKo,'Value',get(handles.sliderKo,'Min'));
set(handles.editKo,'String',num2str(get(handles.sliderKo,'Min')))
end
handles.k_o=k_o;
guidata(hObject, handles);
% --- Executes on slider movement.
function sliderSodium_Callback(hObject, eventdata, handles)
% hObject handle to sliderSodium (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
na_o=get(handles.sliderSodium, 'value');;
set(handles.editSodium,'String',num2str(na_o));
handles.na_o=na_o;
% Update handles structure
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -