Page 1 of 1

Accessing neuron variables in MATLAB

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

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.

Re: Accessing neuron variables in MATLAB

Posted: Fri Jan 25, 2013 2:48 am
by JimH
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.

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