1

I use a Matlab Engine API in order to verify my hdl design. Often, while testing I need to debug some matlab functions. Problem is when I forget to quit debug and then start another simulation, things will go wrong, so I decided to check if matlab is in debug and quit if so via Engine API. I tried this code:

if(~isempty(dbstack()))
    dbquit('all')
end

which works fine if I test it in my opened Matlab session, but if I run this code via Matlab Engine, I will not quit from debug.
As I understand, problem is when I use API, I create a new session which dbstack is not correspond one from previously opened session so I can't affect on it. Is there a way to solve this problem?

Community
  • 1
  • 1

0 Answers0