Note that the called command allocates dynamic memory to store the resultant mxArray s. However, if heap space is at a premium, you may want to call mxDestroyArray as soon as you are finished with the mxArray s that plhs points to. This value must be less than or equal to 50. See mexFunction for a complete description of the arguments. If you want a different error behavior, turn on the trap flag by calling mexSetTrapFlag .
Examples See mexcallmatlab.c in the mex subdirectory of the examples directory.