CTP FOR MATLAB MEX