How do i use the timer function to execute a script at 06:00hrs each day monday through friday
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Charles
el 14 de Sept. de 2017
Respondida: Jan
el 15 de Sept. de 2017
I currently have the following but i want this to occur each day at the same time
T1 =timer(TimerFcn','myscriptname')
Startat(T1,"06:00:00');
delete(T1)
0 comentarios
Respuesta aceptada
Jan
el 15 de Sept. de 2017
Using a timer requires your computer to be not in sleep mode and Matlab must be running. This is rather inefficient for a "each day" job. A scheduled task (Windows) or cron job (Linux/Mac, also systemd) might be a better solution. You can either compile the Matlab code or start Matlab with the -r switch to start a specific function or script.
See e.g. https://www.groovypost.com/howto/schedule-wake-sleep-windows-automatically/ for waking up a Windows PC by a scheduled task. Afterwards e.g. https://www.mathworks.com/matlabcentral/fileexchange/37647-winpower can set the computer to sleep again, or let Windows decide this with the standard methods after a certain period of time.
0 comentarios
Más respuestas (1)
Walter Roberson
el 14 de Sept. de 2017
Set up the timer with TasksToExecute infinite and Period 60*60*24 and execution mode FixedRate.
2 comentarios
Walter Roberson
el 15 de Sept. de 2017
'ExecutionMode' 'fixedRate'
'Period'
'TasksToExecute'
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!