edovanveen / matlabneuroninterface

Interface for connecting NEURON and MATLAB
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

NEURON Toolbox for MATLAB

:warning: For now, only Windows with MinGW is supported.

The NEURON Toolbox provides a MATLAB API to NEURON, using the MATLAB provided clibgen and clib packages to connect MATLAB and NEURON.

The NEURON simulation environment is used in laboratories and classrooms around the world for building and using computational models of neurons and networks of neurons.

About this toolbox:

MATLAB is a registered trademark of The MathWorks, Inc.

For more detailed technical information about e.g. code structure, see doc/DEV_README.md.

Usage

Setup

First, make sure NEURON for Windows is installed (see http://neuron.yale.edu/). Also make sure to set MinGW-w64 as your MEX C++ compiler; for more information about this, run mex -setup cpp in MATLAB.

To get the toolbox working on your machine, run the MATLAB scripts in the following order:

Example scripts

A comprehensive example live script, encompassing the smaller examples and providing additional explanation, can be found at examples/example_livescript.mlx.

Smaller example scripts are available at:

example_acpot should result in:

Action potential

Basic API usage

The main Neuron class can be found at neuron.Neuron. We can initialize a Neuron session by instantiating it:

n = neuron.Neuron();

Now all top-level variables, functions and classes can be accessed using this object. The available variables, functions and classes, as well as their Neuron types can be displayed with:

n.list_functions();

Top-level variables, functions and objects can be called directly. E.g.:

disp(n.t);                  % Display the time
n.fadvance();               % Advance by one timestep
v = n.Vector();             % Create a Vector object

If you create an object like a Vector, you can see a list of its properties and methods with:

v.list_methods();