In [1]:
# load
from pymatbridge import Matlab
mlab = Matlab()
mlab = Matlab(matlab='/Applications/MATLAB_R2014a.app/bin/matlab')
%load_ext pymatbridge


Starting MATLAB on ZMQ socket ipc:///tmp/pymatbridge
Send 'exit' command to kill the server
............................................................Matlab session timed out after 60 seconds
MATLAB failed to start

In [ ]:
%%matlab
a = 1

In [3]:
%%file f.m
function f()
    % imfinfo show images in file - here we want image nr two (of three)
    image = imread('sample.tif', 'Index', 2);
    image(100:110,100:110)
end


Overwriting f.m

In [4]:
res = mlab.run_func('f.m')


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-0bac4eddfe65> in <module>()
----> 1 res = mlab.run_func('f.m')

/Users/arve/Dokumenter/git/FY3490/.vs.env/lib/python2.7/site-packages/pymatbridge/pymatbridge.pyc in run_func(self, func_path, func_args, maxtime)
    197 
    198         req = json.dumps(req, cls=ComplexEncoder)
--> 199         self.socket.send(req)
    200         resp = self.socket.recv_string()
    201         resp = json.loads(resp, object_hook=as_complex)

AttributeError: 'NoneType' object has no attribute 'send'