Failed to use system () and win 10 bash.exe in Matlab

I am trying to use new bash functionally from windows 10 to run a linux program through matlab.

In this particular case, it is a program called snaphu that processes the input file and generates the output file. On linux (or the new bash shell in win10), you start it like:

snaphu -f configfile inputfile

      

You can run this command directly in cmd with:

bash -c "snaphu -f configfile inputfile"

      

This process processes the file and generates an output file. I am using matlab to create an input file and I would like to run snaphu after creating this file with

system('bash -c "snaphu -f configfile inputfile"')

      

use matlab to process the output file it generates in a single worker thread. However, using this command, I am not getting my output file. However adding and working.

system('bash -c "snaphu -f configfile inputfile" &')

      

The problem with this approach is that I am using a for loop to process about 1000 of these input files, each different from the last iteration. If I use "&" every time a new window opens.

I don't understand why it generates an output file in the latter case, but not the first. Can anyone help me?

+3
bash cmd windows-10 matlab


source to share


No one has answered this question yet

Check out similar questions:

fourteen
Vim and matlab GUI - Emulate Matlab Run (<F5>) with Vim
3
Cannot close text file because MATLAB uses it after unsuccessful execution
2
Solution of a large ODE system in Matlab
1
Unix command error inside MATLAB
1
python subprocess.call () cannot find Windows Bash.exe
1
Running a background Matlab instance on Mac OS X
1
Run program as (linux style) foreground process on windows?
0
Matlab () system running C ++ Executable
0
In Sublime3 (Win) add the build system for the environment to WSL
-2
.exe works in cmdline, not matlab unix ()



All Articles
Loading...
X
Show
Funny
Dev
Pics