Cannot plot on Matlab

2 次查看(过去 30 天)
Alex Din
Alex Din 2019-10-29
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 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by