Filter löschen
Filter löschen

Does Matlab system call wait for the operation to finish before continuing with the script?

37 Ansichten (letzte 30 Tage)
I have a script where I am making system calls such as:
cmd = 'tar -xvf filename.tar';
system(cmd);
My question is, once Matlab has started the system call, does it continue on with the Matlab script immediately or does it wait for the system call to finish outside Matlab before continuing on with the script?
Thanks in advance! James

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Mär. 2013
It waits for the process. However if the process starts a subprocess and then exits, it will not wait for the subprocess. So if you do not want it to wait, add " &" to the end of the command.
cmd = 'tar -xvf filename.tar &';

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by