How can I divide a line of code in the ODE solver into two lines of code?
显示 更早的评论
Hello guys,
This is the first question Im asking on the forum, so forgive me if I'm a bit awkward in formulating the question. Please tell me if I need to add/change anything :)
I want to solve a large set of equations in the ODE 15s solver. This is an example of one line:
dy(212) = 1./tau.*(ggluta_bound.*Sg(:,212).*(Egluta-V(212))+
(gGABA_rest+(gGABA_bound-gGABA_rest).*1.*(SG2(39)))
.*(EGABAp-V(212))+gK.*(EK-V(212))+delta.*((V(211)-V(212))+(V(229)-V(212))));
I actually want to write this line like this:
dy(212) = 1./tau.*(ggluta_bound.*Sg(:,212).*(Egluta-V(212))+
gGABA(212)
.*(EGABAp-V(212))+gK.*(EK-V(212))+delta.*((V(211)-V(212))+(V(229)-V(212))));
with an additional line:
gGABA(212)=gGABA_rest+(gGABA_bound-gGABA_rest).*1.*(SG2(39));
But somehow this doesnt work in the ODE solver. Is there anyway around this? It would make the code a bit more readable.
Thanks!
Sanne
.....................
PS: SG2's derivative (dSG2) is also computed in the solver.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!