TomE8
TomE8

Reputation: 576

run python script in parallel to matlab

I have 2 scripts:

  1. python script
  2. matlab script

I need to run this two scripts in parallel (no output for both of them). I was thinknig to call to the python scirpt, from the matlab script.

I know it is possible to run python script from matlab like:

systemCommand='my_script.py'
system(systemCommand)

however in this way, the matlab script will wait to the return of the python script, and the rest of my matlab script will not be executed.

any ideas?

Upvotes: 2

Views: 738

Answers (1)

Suever
Suever

Reputation: 65430

As mentioned near the end of MATLAB's system documentation in the "Tips" section, to run a system command in the background (on *nix), you can append an ampersand(&) to the end of your command to tell it to run in the background.

system('my_script.py &')

If you're on Windows, you'll want to use the following to prevent a command window from opening.

system('start /b my_script.py');

Upvotes: 1

Related Questions