We have matlab .m files which have been compiled to a DLL using mcc. This is used by a C++ GUI application which we debug in Visual Studio. When we reach the call to our matlab function, all we can do is step over it. How can we debug, at a source code level, the .m code?
I figured it would be easy to add some 'print' statements, which in matlab are actually called 'disp', and watch stuff scroll by in VS's output window. But we see nothing. Not even from printf() in the C++ source, or when running our app directly from a command line instead of in VS. From Google and S.O., we learn that nothing sent to stdout ever shows up anywhere. (This question is relevant: Visual Studio 2012 C++ Standard Output but didn't work for us.)
I tried msgbox('blah blah') in the .m scripts, and rebuilt the DLL. Nothing came up. I'm not sure if this should work but our matlab code didn't execute, or if msgbox isn't expected to work in this situation, like stdout.
We'd be happy with print-based debugging. Breakpoints and other techniques would be nice, but not necessary at this time.
We use Matlab R2016b on Win7, Visual Studio 2015. We have the .m source used to make the DLL, and we have the source for the GUI app using the DLL.