How can I let MATLAB know when my shell script is completed its execution so that MATLAB can retrieve results in MATLAB 7.8 (R2009a)?
1 次查看(过去 30 天)
显示 更早的评论
I have a shell script that does computation and produces results. I retrieve these results and does analysis in MATLAB. I want to know if there is any automatic way that I can have MATLAB started to analyze results once the computation from the shell script is completed.
采纳的回答
MathWorks Support Team
2009-6-27
There is no direct way to do this. You may try the following workarounds:
1. Set your own environment variable and use MATLAB timer to check its value:
You can set your own system-wide environment variable, and set it to a certain value at the end of your program. You can make use of MATLAB timer to check its value at a fixed rate. For this method, you would need to start MATLAB and start the timer with a callback function that checks the value of this environment variable during the execution of your script.
A couple of things to keep in mind:
(1) It is known that an environment variable set using SETENV in MATLAB is only visible within MATLAB on a Windows machine:
<http://www.mathworks.com/support/solutions/data/1-3IOL0N.html>
Please make sure the environment variable you set is visible for other processes.
(2) MATLAB timer:
If you would like more information on MATLAB timer, please refer the following documentation:
- Timer object:
<http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f9-38134.html>
- Starting and stopping timer:
<http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f9-38272.html#f9-41266>
2. Call MATLAB within your script:
At the end of your script, you may start MATLAB with '-r' option so that specified MATLAB function can run upon startup. Please refer the following documentation for detailed information:
- Starting MATLAB on UNIX platforms:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/matlabunix.html>
- Startup options:
<http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f8-4994.html>
<http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_env/f8-4994.html>
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!