フィルターのクリア

Call Matlab Script From Command Line and then Exit Matlab Process

12 ビュー (過去 30 日間)
Ledger Yu
Ledger Yu 2015 年 4 月 10 日
回答済み: Ledger Yu 2015 年 4 月 16 日
I tried to schedule a Matlab code called "DailyProcess.m" using Windows Task Scheduler. Below is the batch file:
matlab -r "run C:\Code\DailyProcess.m;" -logfile "C:\Log\log.txt"
The whole process runs fine. The problem is that it leaves Matlab open at the background after the process is done (I can see that matlab process from Windows Task Manager taking 0 CPU and some memory).
If I put an "exit" syntax in the batch line this:
matlab -r "run C:\Code\DailyProcess.m;exit" -logfile "C:\Log\log.txt"
it will still run the script, but it won't output the log file since Matlab already exits before it can write the log file.
Any idea on how to run the script, output the log, and then exit the process?
Thanks a lot in advance.

採用された回答

Ledger Yu
Ledger Yu 2015 年 4 月 16 日
The answer, as it turned out, is to simply put "exit" inside the script...

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by