views:

61

answers:

2

Hi, I try to run and debug a script file from the matlab engine. Using breakpoints in my C++ program, I could open a Matlab editor and set a breakpoint in my script. When I continue the C++ program, the breakpoint gets hit, but Step through or similar commands do not work (as well as inspect variables or continue running). Is there any way to debug the code?

Thanks, Philipp

A: 

Maybe I don't understand the question, but the Matlab editor has the usual debug command buttons like step over, into etc.

Ben
thanks, but the problem is that I cannot click them - nothing happens or sometimes Matlab will even crash (I've reported a bug to Mathworks for this.)
Philipp Crocoll
A: 

Can you clarify the relationship between Matlab and C++ in the situation you are dealing with? Because you mention C++, it seems you are not simply trying to debug a Matlab function or script using the Matlab debugger, correct?

(If you are new to Matlab and/or its debugger make sure to type 'doc debug' and familiarize yourself with the commands.)

Matt Mizumi
The Matlab Engine allows to call Matlab scripts from programs written in other languages, in my case it's C++. See http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f29148.html for more information. (A Matlab Command Window is started when the COM connection is opened, and from this window I tried to debug.)
Philipp Crocoll
Matt Mizumi