Add mex gateway routine created by previous assistant