I got it, I thought matlab could do it by itself, but instead I modify the batch file of the program.
close terminal window
16 views (last 30 days)
I make a program wich open the terminal window(C:\WINDOWS\system32\cmd.exe) at each time it's fired. I use it in a loop, so I got many useless terminal windows.
My question is : how to close a terminal window from matlab.
More Answers (3)
Fangjun Jiang on 7 Nov 2011
Assume you run your MATLAB code as system('MyProgram.exe') and it brought up that ugly black window but never exits, you can do this:
system('MyProgram.exe < Exit.txt'), where Exit.txt is a text file you created ahead of time. The text file contains one line, which is 'exit' without both the single quotes.
Martijn van Sluis on 15 Feb 2018
Edited: Martijn van Sluis on 15 Feb 2018
Perhaps not so elegant, but if you incorporate the following it works just fine: