Can I schedule a job in Matlab online

6 views (last 30 days)
Prasanna S
Prasanna S on 20 Oct 2020
Answered: Michael Croucher on 20 Oct 2020
Hi Team,
I would like to know if I can schedule to run a job in background using matalb online.
I have *.m file, which I need to execute once in an hour, Is it possible for me to schedule a job to run this in background in matlab online.

Answers (2)

Walter Roberson
Walter Roberson on 20 Oct 2020
You can use timer objects.
Note that MATLAB Online will time out if you do not interact with the session from time to time. Something like every 15 minutes.
You cannot use MATLAB Online to run code when you are not connected with an active session.

Michael Croucher
Michael Croucher on 20 Oct 2020
One way of achieving your aim would be to use the public cloud. Compile your .m file using MATLAB Compiler, install it on a cloud VM instance and use something like AWS Instance Scheduler to schedule the running of your machines.
There'd be a bit of additional work to do such as getting your input/output from S3 object store https://www.mathworks.com/help/matlab/import_export/work-with-remote-data.html and you'd also need to experiment with instance sizes to ensure you get the cheapest one possible for your workload.
I've never actually done this for MATLAB but I can't see why it shouldn't work.
There's also a reference Docker implementation: https://github.com/mathworks-ref-arch/matlab-dockerfile which you might be able to make use of for a Docker based workflow.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!