- Click on Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks -> Add Scheduled Task
- Choose MATLAB.
- After you finish setting up the scheduled task, open the task's "Properties".
- If under "Run" : is specified, change it to:D:\MATLAB.exewhere "mfile" is the name of the MATLAB file you want to execute. If you use the option "-logfile", then any MATLAB Command Window output will be saved in "C:\logfile". You can also define multiple commands, separated by commas or semi-columns. For example:D:\MATLAB.exe -r mfile [-logfile C:\logfile]would change the current directory to "C:\" (where the MATLAB file "mytest.m" assumably lives), run "mytest.m" and exit MATLAB. The MATLAB Command Window output will be saved in "C:\logfile".D:\MATLAB.exe -r cd('C:\'), mytest, exit -logfile C:\logfile
- Click on Start -> Task Scheduler
- In Task Scheduler, click on "Create Task".
- In "General" tab set the "Name" field to the name of the task.
- In the "Triggers" tab click "New" to select the desired trigger time and frequency of the task. Click "Ok" to save the task.
- In the "Actions" tab, click "New". The "Action" should be kept as "Start a program".
- For "Program/script", use "Browse..." to find the MATLAB executable, which should be a value like: C:\Program Files\MATLAB\R2011b\bin\matlab.exe
- Set arguments to:It is not required to specify the ".M" extension here.-r scriptname; quit
- Set the "Start in" value as the directory containing the script file, e.g.:Click "Ok" to save your changes.C:\users\username\Desktop\Folder
- Click "Ok" to finish and save.