I have just rewritten a Matlab program in c++ as a mex-function to speed things up, with fantastic results. This optimization decision was a very very good idea, with up to a fa
Two possible solutions in addition to the fine ones already suggested.
It's possible to write a script which loads the data, runs your mex function, and then exits. You can then let the profiler call the Matlab executable with that script. This worked for me with nVidia's visual profiler when I was profiling my CUDA mex functions.
If you built the mex function in Visual Studio, you should be able to do attach to the Matlab process and then run the function for either debugging or profiling.