From Matlab to JavaScript

Recently I’ve been reading an introductory book about Computational Neuroscience (Tutorial on Neural Systems Modeling). You may wonder if this is complicated. Well, you’re right, it is complicated ¯\(ツ)/¯.

The scripts taken from this book are written in Matlab. Since I’m a huge believer of Open Source-ness I thought it could be nice to port this into JavaScript.

Let’s have a look at one of the first examples. The following script is quite simple. It just simulates the response of the brain to a continuous stimulus (i.e. Habituation).

So let’s port this into JavaScript! Some of the latest trends on web technologies are being used here: ECMAScript 2015, Webpack & d3.js

You could see the output of both scripts: Matlab (first) & JavaScript (last):

Output Octave Output JavaScript

In conclusion, as a learning exercise we’ve taken some Matlab code and ported it into JavaScript. Octave is a nice alternative for this.

OpenSource FTW!