MATLAB: Doesn’t the MEX function call from MATLAB match the signature in the MEX file

MATLABmex function signatures c

After completing the "Create A C Source MEX File" tutorial https://www.mathworks.com/help/matlab/matlab_external/standalone-example.html, I'm not clear on how the mapping of function signatures works from MATLAB to C.
In the example (arrayProduct.c), there are two functions in the example MEX file. One is (void) arrayProduct(double, double*,double*,int). The second is the required entry function which has a void return type and arguments (int, mxArray*, int, const mxArray*). When calling the function from MATLAB however, the signature doesn't match either of the functions in the MEX file: [returns matrix] arrayProduct(number,Matrix).
Intuitively, I would expect the function arrayProduct in the .c file to have the same signature as what would be called from MATLAB.
The question is – given a random MEX (*.c) file, how can I tell what the function signature needs to be when called from MATLAB?

Best Answer

Normal mex functions need to have parameters for the number of output arguments, the pointers to the output arguments, the number of input arguments, and the pointers to the input arguments.