How can I divide a line of code in the ODE solver into two lines of code?
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!