This appears to use a non-supplied mex function. It fails to run as is.
There are no comments. No help at all. No error checking. No hints anywhere what the return arguments mean or what it expects as input. Undocumented, random code that fails to work does not belong on the file exchange.