Automatically Run a Matlab Script
Show older comments
I have a script that I want to run automatically, every 5 seconds. How could I set this up so that it runs in an unattended manner?
Answers (1)
the cyclist
on 3 Mar 2020
0 votes
9 Comments
fahd Belmajdoub
on 3 Mar 2020
the cyclist
on 3 Mar 2020
Oh, sorry. I should have clicked through to link they suggested. But I think what you want in Windows is the Task Scheduler.
To my knowledge, there is no task-scheduling ability that is fully internal to MATLAB.
fahd Belmajdoub
on 3 Mar 2020
Steven Lord
on 3 Mar 2020
I'm not completely certain since I haven't used it myself, but if you're not already aware there is an OPC Toolbox that may be of use to you. The "Data Access" section may describe functions and functionality that would be useful to you.
fahd Belmajdoub
on 5 Mar 2020
the cyclist
on 5 Mar 2020
The page I linked has a section entitled "How to create an advanced task ...".
It looks to me that #21 in that section describes how to repeat the task at higher frequency. (The internet suggested the same to me.)
I don't know if you can go down all the way to 5 seconds, though.
fahd Belmajdoub
on 5 Mar 2020
Steven Lord
on 5 Mar 2020
Do you need to run the script from the beginning every five seconds, or would running a script that loops indefinitely and polls for data to process every five seconds be sufficient?
fahd Belmajdoub
on 5 Mar 2020
Edited: fahd Belmajdoub
on 5 Mar 2020
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!