Modified MATLAB API to use the new C++ interface