I have a script that I run via a timer every 30 minutes -- how do I run this in background?
40 views (last 30 days)
Geoff Hayes on 22 Nov 2017
Robert - try creating a function that you can call from the command line. It will instantiate a timer and then periodically (whenever the timer callback fires) will do some work. For example, in a file named timerInBackground.m you could have
function [myTimer] = timerInBackground
myTimer = timer('Name','MyTimer', ...
function myTimerCallback(hObject, eventdata)
Then call this function from your command window as
myTimer = timerInBackground;
Then every 30 minutes (30*60 seconds) the timer callback will fire and (in this case) print a hello! message to the console window. In the meantime, you can continue with other MATLAB tasks.