Here is a useful resource for understanding how to compile C code using mex on 64 bit devices: http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html?s_tid=doc_12b#bsgpkjp-3
The main pitfall is that the mex command uses the -compatibleArrayDims flag (32-bit API) by default. This results in the addition of the -DMX_COMPAT_32 flag in the call to mex. As mentioned above, this resulted in an error message stating that the array dimension I was passing in was incorrect: MKL ERROR: Parameter 1 was incorrect on entry to SGETRF. Merely changing the integers to a 64bit compatible type was not sufficient.
The fix was to include the -largeArrayDims flag in the call to mex and declare array indices as type mwSize. Since the S function is recompiled by the call to sim, it is necessary to set Simulation>Model Configuration Parameters>Device type> to the relevant 64-bit setting.
I don't understand why the -compatibleArrayDims flag is set automatically on a 64-bit machine. Perhaps someone can enlighten me.