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

📄 lrd2007.m

📁 Luo-Rudy cardiac cellular action potential model
💻 M
📖 第 1 页 / 共 3 页
字号:
% --- Executes when figure1 is resized.
function figure1_ResizeFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)




% --- Executes on button press in togglebutton2.
function togglebutton2_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

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




% --- Executes on button press in checkbox2.
function checkbox2_Callback(hObject, eventdata, handles)
% hObject    handle to checkbox2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

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




% --- Executes on button press in checkMiddle.
function checkMiddle_Callback(hObject, eventdata, handles)
% hObject    handle to checkMiddle (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of checkMiddle
    axes(handles.axes2)
    handles.v=1;


guidata(hObject, handles);

% --- Executes on button press in Bottom.
function Bottom_Callback(hObject, eventdata, handles)
% hObject    handle to Bottom (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of Bottom
    axes(handles.axes3)
    handles.v=0;


guidata(hObject, handles);

% --------------------------------------------------------------------
function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)
% hObject    handle to uipanel1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
selection = get(hObject,'SelectedObject')
switch get(selection,'Tag')
case 'Bottom'
'bottom'
case 'checkMiddle'
% code piece when radiobutton2 is selected goes here
'middle'
end



% --- Executes on button press in pushbuttonClose.
function pushbuttonClose_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonClose (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Get the current position of the GUI from the handles
% to pass to the modal dialog.
pos_size = get(handles.figure1,'Position');
% Call modaldlg with the argument 'Position'.
user_response = modaldlg('Title','Confirm Close');
switch user_response
case {'No'}
% take no action
case 'Yes'
% Prepare to close GUI application window
% .
% .
% .
delete(handles.figure1)
end

% --- Executes on button press in pushbuttonSave.
function pushbuttonSave_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonSave (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

t=handles.Time*1000;%% conversion second to milliseconds
currents=handles.currents;
States=handles.State;
%save  DATA.mat  t States currents 
% Get the Tag of the menu selected
Tag = get(hObject, 'Tag');
% Get the address array
% Addresses = handles.Addresses;
% Based on the item selected, take the appropriate action
switch Tag
case 'Save'
% Save to the default addrbook file
%File = handles.LastFile;
%save(File,'Addresses')
%save  DATA.mat  t States currents 
case 'pushbuttonSave'
% Allow the user to select the file name to save to
[filename, pathname] = uiputfile( ...
{'*.mat';'*.*'}, ...
'Save as');
% If 'Cancel' was selected then return
if isequal([filename,pathname],[0,0])
return
else
% Construct the full path and save
File = fullfile(pathname,filename);
save(File,'t','States','currents','-v6') 
% save(File,'Data')
% save(File,currents)
%handles.LastFile = File;
guidata(hObject, handles)
end
end


% --- Executes on button press in pushbuttonHelp.
function pushbuttonHelp_Callback(hObject, eventdata, handles)
% hObject    handle to pushbuttonHelp (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



HelpPath = which('HELP_LRd2007.html');
web(HelpPath);



function editLastBCL_Callback(hObject, eventdata, handles)
% hObject    handle to editLastBCL (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 editLastBCL as text
%        str2double(get(hObject,'String')) returns contents of editLastBCL as a double
LastBCL = str2double(get(handles.editLastBCL,'String'));
handles.LastBCL =LastBCL;

guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function editLastBCL_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editLastBCL (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




% --- Executes on button press in pushLoad.
function pushLoad_Callback(hObject, eventdata, handles)
% hObject    handle to pushLoad (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)


[file,path]=uigetfile('*.mat','Select the MAT-file');
%data = load(fullfile(file));
if file~=0
load(file);

Import(States,currents,t,handles);

end


function b=Import(State,currents,t,handles)

b=1;
t=t/1000;%% Conversion msec to second
handles.t=t;
handles.State=State;
handles.currents=currents;
handles.Time=t;
handles.V=State(:,1);
handles.H=State(:,2);
handles.M=State(:,3);
handles.J=State(:,4);
handles.d=State(:,5);
handles.f=State(:,6);
handles.Xr=State(:,7);
handles.Ca=currents.Cafree;
handles.Nai=State(:,9);
handles.Kai=State(:,10);
handles.JSR=currents.JSRfree;
handles.NSR=State(:,12);
handles.XS=State(:,13);
handles.Bc=State(:,14);
handles.Gc=State(:,15);
handles.XS2=State(:,16);

handles.INa=currents.INa;

%handles.icatot=currents.catot;
handles.ical=currents.ical;
handles.icalna=currents.icalna;
handles.icat=currents.icat;
handles.icalk=currents.icalk;
handles.itr=currents.itr;
handles.ikr=currents.ikr;
handles.iup=currents.iup;
handles.inak=currents.inak;
handles.stm=currents.stm;
handles.ir=State(:,17);
handles.IKp=currents.IKp;
handles.caiont=currents.caiont;
handles.inaca=currents.inaca;
handles.ileak=currents.ileak;
handles.ipca=currents.ipca;
handles.cmdn=currents.cmdn;
handles.trpn=currents.trpn;
handles.csqn=currents.csqn;
handles.iks=currents.iks;
handles.inab=currents.inab;
handles.icab=currents.icab;
handles.IK1=currents.IK1;

handles.G_Ks=currents.G_Ks;
handles.G_Kr=currents.G_Kr;
handles.G_K1=currents.G_K1;
handles.fca=currents.fca;

handles.caiont=currents.caiont;
handles.kiont=currents.kiont;
handles.naiont=currents.naiont;

% handles.Int_caiont=currents.Int_caiont;
% handles.Int_naiont=currents.Int_naiont;
% handles.Int_kiont=currents.Int_kiont;
 handles.I_Total=currents.naiont+currents.kiont+currents.caiont;
% 
% handles.SR_flux_avg=currents.SR_flux_avg;
% handles.SR_flux=currents.SR_flux;







axes(handles.axes1)
    h=plot(t,State(:,1));set(h,'LineWidth',2')
set(handles.axes1,'XMinorTick','on')
grid on; zoom on

ylabel('V (mV)','FontSize',10,'FontWeight','bold','FontWeight','bold');
set(gca,'FontWeight','bold','FontSize',10,'FontWeight','bold')
xlabel('Time (sec)','FontSize',10,'FontWeight','bold')


axes(handles.axes2)
h2=plot(t,1000*handles.Ca);
zoom on;   set(h2,'LineWidth',2')
set(handles.axes2,'XMinorTick','on')
grid on ; ylabel(' Ca^{2+} (\mu M)','FontSize',10,'FontWeight','bold')
set(gca,'FontSize',10,'FontWeight','bold')
xlabel('Time (sec)','FontSize',10,'FontWeight','bold')
set(gca,'FontSize',10,'FontWeight','bold')
axes(handles.axes3)
h2=plot(t,handles.stm);
zoom on;   set(h2,'LineWidth',2')
set(handles.axes2,'XMinorTick','on')
grid on ; ylabel(' Stimuli (\mu A/\mu  F) ','FontSize',10,'FontWeight','bold')
set(gca,'FontSize',10,'FontWeight','bold')
xlabel('Time (sec)','FontSize',10,'FontWeight','bold')
%guidata(hObject, handles)
linkaxes([handles.axes1 handles.axes2 handles.axes3],'x');
guidata(handles.output,handles);


% --- Executes on slider movement.
function sliderCalcium_Callback(hObject, eventdata, handles)
% hObject    handle to sliderCalcium (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
ca_o=get(handles.sliderCalcium, 'value');;
set(handles.editCalcium,'String',num2str(ca_o));


handles.ca_o=ca_o;


% Update handles structure
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function sliderCalcium_CreateFcn(hObject, eventdata, handles)
% hObject    handle to sliderCalcium (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.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end



function editCalcium_Callback(hObject, eventdata, handles)
% hObject    handle to editCalcium (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 editCalcium as text
%        str2double(get(hObject,'String')) returns contents of editCalcium as a double

ca_o = str2double(get(handles.editCalcium,'String'));

if  ca_o >= get(handles.sliderCalcium,'Min') & ...
        ca_o <= get(handles.sliderCalcium,'Max')
    set(handles.sliderCalcium,'Value', ca_o);
elseif ca_o >get(handles.sliderCalcium,'Max')
    set(handles.sliderCalcium,'Value',get(handles.sliderCalcium,'Max'));
    set(handles.editCalcium,'String',num2str(get(handles.sliderCalcium,'Max')))
elseif ca_o < get(handles.sliderCalcium,'Min')

    set(handles.sliderCalcium,'Value',get(handles.sliderCalcium,'Min'));
    set(handles.editCalcium,'String',num2str(get(handles.sliderCalcium,'Min')))

else

    set(handles.sliderCalcium,'Value',get(handles.sliderCalcium,'Min'));
    set(handles.editCalcium,'String',num2str(get(handles.sliderCalcium,'Min')))
end

handles.ca_o =ca_o ;
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function editCalcium_CreateFcn(hObject, eventdata, handles)
% hObject    handle to editCalcium (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 && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on button press in togglebutton4.
function togglebutton4_Callback(hObject, eventdata, handles)
% hObject    handle to togglebutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of togglebutton4
printdlg('-crossplatform')
%
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

printdlg


% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% hObject    handle to Untitled_2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

printpreview

⌨️ 快捷键说明

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