Added Matlab interfacing