How to initiate a linux (shell) command from matlab but not wait for the output?

I know I can use the function unix (or system), but it has to wait the script to return. The script actually will run for a long time. I prefer matlab function to return immediately after calling the shell script. Is it possible?
Thanks a lot in advance!

 채택된 답변

If you end the command line with an ampersand, system should return immediately
system('some-long-running-command &');
Of course, you won't be able to capture the output of the command.

댓글 수: 2

Thanks a lot! It works!!
Hi. My problem is that I'm running multiple files with & in the background and am using system('wait') for all of them to complete. However, system('wait') is not working. I'd appreciate your response.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

질문:

2013년 7월 12일

댓글:

2015년 2월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by