tags:

views:

32

answers:

1

How do I debug Matlab code called from Microsoft Excel?

Is there a way to print messages to the Matlab runtime console that always pops up when I call the .m file from Excel?

Extra for experts

  • I'm calling Matlab code from Excel using Spreadsheet Link EX 3.1.1, a plugin for Excel.
+2  A: 

To just print stuff programmatically, call disp() or fprintf() from the Matlab code you're running. You may need to call drawnow() to get the display to update.

To debug interactively, set a breakpoint in your M-code by calling dbstop(...), or drop in to the debugger immediately by calling keyboard(). You can invoke these via the Spreadsheet Link call mechanism like any other Matlab function. That should drop you in to the "K>>" debugger prompt in the Matlab runtime console that comes up.

Andrew Janke

related questions