Scheduling a Matlab Script
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Brian
le 23 Mai 2012
Commenté : Tharikaa Ramesh Kumar
le 11 Juin 2024
I am attempting to schedule a Matlab job each day using the windows scheduler. I am having trouble getting it to run my m file. I am using the code below in the Windows 7 professional task scheduler.
This is my action - matlab -r cd('\\lbprds0262\invest\Factset\AssetAllocation\PeerGroups\'),'\\lbprds0262\invest\Factset\AssetAllocation\PeerGroups\PeerGroupMedians_Weekly_FSPull_Auto.m',exit
I also referenced this - <http://www.mathworks.com/support/solutions/en/data/1-361S45/index.html?product=ML&solution=1-361S45>
It launches Matlab just fine but it just sits there and nothing runs.
Thanks! Brian
1 commentaire
Tharikaa Ramesh Kumar
le 11 Juin 2024
Do you run time-consuming tasks on MATLAB and Simulink? Do you wish you could schedule them and run them in the background, unattended? How do you solve this question today?
MATLAB Product team is very interested to talk to you and learn from your experience. Please participate in this brief survey (6 questions).
Réponse acceptée
Daniel Shub
le 23 Mai 2012
You need to enclose the entire command in quotes. You do not need the path on the function/script you want to run and do not want to put it in quotes. This should work
matlab -r "cd('\\lbprds0262\invest\Factset\AssetAllocation\PeerGroups\'); PeerGroupMedians_Weekly_FSPull_Auto.m; exit"
but I would consider this
cd \\lbprds0262\invest\Factset\AssetAllocation\PeerGroups\
matlab -r "PeerGroupMedians_Weekly_FSPull_Auto.m; exit"
where you change to the desired directory before launching MATLAB.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!