문제

I have a Matlab code which uses a function called foo.

This function has been written in C (foo.c being the original file) and compiled in order to generate a Matlab library called foo.mexa64.

The code runs successfully.

My question is: Is there any way to debug this function foo within Matlab?

I need to know, step by step, some local value inside foo function!

도움이 되었습니까?

해결책

Not it's not possible using only MATLAB.

I haven't tried, but it is possible using general purpose c/c++ debuggers. Mathworks has a pretty detailed documentation on how to do this:

http://www.mathworks.de/de/help/matlab/matlab_external/debugging-c-c-language-mex-files.html

다른 팁

As you only appear to be interested in one specific value, this may also be a solution to you:

Change the c code, rather than keeping the variable internally return it at every step or store it in an array and return it to matlab after a number of steps.

This should allow for quickly checking the impact of changes in your wrapping/calling Matlab code, but of course the question remains whether one would call this debugging.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top