you can use macro mxAddMexFile with the complete path of your mex file and the number of arguments in input and after it's possible to call function with the same same as your mex file with only arguments needed by the mexFunction