Saturday 24 January 2015

Run matlab on web browser by IPython notebook (on ubuntu 14.04)

To run Matlab commands in Ipython Notebook, we need install Python-matlab-bridge (see http://arokem.github.io/python-matlab-bridge/)

1. Install libzmq from zeromq (http://zeromq.org/intro:get-the-software)
- read : to build on Unix-like system
- download source code (zeromq-4.1.0-rc1.tar.gz)

$ sudo apt-get install libtool pkg-config build-essential autoconf automake
$ sudo apt-get install uuid-dev
$ tar xvfz zeromq-4.1.0-rc1.tar.gz ; cd zeromq-4.1.0-rc1
$ ./configure ; make
$ sudo make install
$ sudo ldconfig

check whether if libzmq.so.4 exists in /usr/local/lib . If found, then update the path in .bashrc

$ nano ~/.bashrc
add:  export LD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib

2. Install pyzmq

$ pip install pyzmq

It seems that this package had already been installed inside Anaconda

3. Install pymatbridge
- download arokem-python-matlab-bridge-0.3-67-g11751dd.tar.gz
from http://arokem.github.io/python-matlab-bridge/

$ tar xvfz arokem-python-matlab-bridge....tar.gz
$ cd arokem-python-matlab-bridge....
$ python setup.py install

4. Run demo as following: http://arokem.org/code/pymatbridge.html

Basically, from web browser (ipython notebook): https://ipaddress:8888
In [1]: import pymatbridge as pymat
In [2]: ip = get_ipython()
           pymat.load_ipython_extension(ip)

No comments:

Post a Comment