run Matlab commands one by one on windows using .bat file

后端 未结 2 1449
粉色の甜心
粉色の甜心 2021-01-26 04:59

I am trying to run a function on different files; I would like to use Bash-Like script to do that. When I looked on the web; I found that I can use .bat file.

My .bat fi

2条回答
  •  情话喂你
    2021-01-26 05:40

    There are two matlab binaries, one matlabroot/bin the other in matlabroot/bin/win64/. The first one is only a launcher application which typically terminates as soon as the main application is started successfully. To keep it open until the main application terminates you have to use the -wait option with your matlab.exe (not to be confused with the start -wait option, bot can be used together).

    In your case try:

    matlab -wait -nodesktop -nosplash -r myFunction('input_1.txt')
    

    (I assume you intended to use "nodesktop").

    All start parameters for windows are explained here in the documentation. (You have to click "option1...optionN" to expand the relevant section.)

提交回复
热议问题