Matlab がデバッグモードのときにメールを受信したいので、次のことを試しました。
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
関数は次のとおりです。
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 が存在しないため、エラーが発生し、Matlab はデバッグ モードになります (エラーがアクティブな場合は dbstop)。feature('IsDebugMode') は 1 ですが、メールが届きません。
Matlab でオブジェクトを操作するのは初めてなので、コードが何らかの形で間違っていると確信しています。多分誰かが私を助けることができますか?前もって感謝します