Cannot plot on Matlab

조회 수: 4 (최근 30일)
Alex Din
Alex Din 2019년 10월 29일
댓글: Walter Roberson 2019년 11월 6일
I'm trying to find plots for the Hodgkin Huxley model using Matlab looked online at some papers and found this below however all I get is the axis.
addpath(genpath(('C:\Users\User\Downloads\DynaSim-master\DynaSim-master')))
eqns={
'gNa=120; gK=36; Cm=1'
'INa(v,m,h) = gNa.*m.^3.*h.*(v-50)' % Inactivating sodium current
'IK(v,n) = gK.*n.^4.*(v+77)' % Potassium current
'dv/dt = (10-INa(v,m,h)-IK(v,n))/Cm; v(0)=-65'
'dm/dt = aM(v).*(1-m)-bM(v).*m; m(0)=.1'
'dh/dt = aH(v).*(1-h)-bH(v).*h; h(0)=.1'
'dn/dt = aN(v).*(1-n)-bN(v).*n; n(0)=0'
'aM(v) = (2.5-.1*(v+65))./(exp(2.5-.1*(v+65))-1)'
'bM(v) = 4*exp(-(v+65)/18)'
'aH(v) = .07*exp(-(v+65)/20)'
'bH(v) = 1./(exp(3-.1*(v+65))+1)'
'aN(v) = (.1-.01*(v+65))./(exp(1-.1*(v+65))-1)'
'bN(v) = .125*exp(-(v+65)/80)'
};
%%data = dsSimulate(eqns);
figure;
%plot(data. time.[0 200] data. membrane potential [0 10])
xlabel('time (ms)');
ylabel('membrane potential (mV)');
title('Hodgkin-Huxley neuron')
How do I go about getting the trace for this?
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 11월 6일
If you have the Symbolic Toolbox then you could consider converting to set up differential equations using symbolic form. I suspect that dsolve() might not be able to deal with the system, but you could use odeFunction() to create functions for use with ode45() or related. See the first example for odeFunction which demonstrates the sequence of functions to use to do proper conversion.

댓글을 달려면 로그인하십시오.

답변 (1개)

Ganesh Regoti
Ganesh Regoti 2019년 11월 6일
Hi,
Cross-verify if you are getting data from you dsSimulate function. If you are getting valid data there are different set of plots which might suit your purpose. Here is the link to plot functionality in MATLAB
There is one another way of plotting your data. If you load the data in workspace then you can use Plot Gallery which contain built-in plots to plot. You can select the plots in PLOTS toolstrip of MATLAB. Here are the built-in plots available in MATLAB

카테고리

Help CenterFile Exchange에서 Neural Simulation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by