title: How do I profile a MEX-function in Matlab
body: <p>I have a Mex-function (a function in c++ that you can call from Matlab) that I have written, and I want to profile it using valgrind/kcachegrind.  I know how to use valgrind/kcachegrind if you are running a c++ program directly, but is there a way to do this profiling if I am calling the c++ program from Matlab?</p>