Accessing neuron variables in MATLAB

Anything that doesn't fit elsewhere.
Post Reply
Krishna Chaitanya
Posts: 70
Joined: Wed Jan 18, 2012 12:25 am
Location: University of Pavia

Accessing neuron variables in MATLAB

Post by Krishna Chaitanya » Sat Dec 29, 2012 11:26 pm

Hi,

I wanted to run a neuron simulation from MATLAB, which I did with the command "!nrngui <file.hoc>". Later I wanted to calculate spikes with APCount procedure in NEURON and return it to MATLAB variable for further computation. One way is to create file, store value into it and open it in MATLAB. Since this needs extra file operations, is there any other way I can access the spike count in MATLAB directly from NEURON (like assigning to a local variable in MATLAB).

Thank you.

JimH
Posts: 54
Joined: Tue Apr 10, 2007 3:36 pm
Location: Duke University

Re: Accessing neuron variables in MATLAB

Post by JimH » Fri Jan 25, 2013 2:48 am

You can setup communication with NEURON using stdin and stdout (string buffers) in Matlab. I have implemented some code which does this on github. The code has a lot more functionality and is still growing and changing but the basics are there.

https://github.com/JimHokanson/matlab_NEURON

Setup takes a minute or two but then you can send messages back and forth to NEURON.

Post Reply