Having code that only works in debug mode in Matlab?

I have a piece of code in my Matlab implementation that looks like a good comment, but in the real scenario, the generated matrix is ​​too large and I cannot save the code. So now this is a comment.

I want to know if there is something like debug mode in Matlab. Sort of

#ifndef NDEBUG

in C?

+4
source share
1 answer

There seems to be an undocumented method described here .

if feature('IsDebugMode')
    % debug code
end

This seems to work in MATLAB 2017a.

+3
source

Source: https://habr.com/ru/post/1696188/


All Articles