I'd like to receive an email when Matlab is in debugging mode, so I tried the following:
timerTic=4; % how often the timer checks
timerHandle = timer();
timerHandle.startDelay = timerTic;
timerHandle.Period = timerTic;
timerHandle.ExecutionMode = 'fixedRate';
timerHandle.TasksToExecute = inf;
timerHandle.TimerFcn = @CheckDebugMode;
j=0;
while t==0
j=j+1;
end
where the funcion is:
function CheckDebugMode( ~ )
% Check if Matlab is in Debug mode
if feature('IsDebugMode')
sendSSLmail('mymail@mycountry','Matlab is in debug mode','Matlab is in debug mode')
end
t doesn't exist so that an error occurs and Matlab enters in debug mode (dbstop if error is active). feature('IsDebugMode') is equal to 1, but I receive no mail.
It's the first time I work with objects in Matlab, so I'm pretty sure the code is in someway wrong. Maybe someone can help me? Thanks in advance