MATLAB: How to completely hide the output of an external program that is executed using the SYSTEM / DOS command in MATLAB 7.6 (R2008a)

bangMATLABoperator

I would like to execute an external program from within MATLAB. The program usually outputs a lot of data in the command or DOS window, how can I suppress this output?

Best Answer

You can suppress output from the DOS and SYSTEM commands by specifying two output arguments. For example, the following command should not print any text to the command window:
[x, y] = dos('dir *.*');
[x, y] = system('dir *.*');
In some cases, you may be able to suppress the output by executing the program by using the Windows "start" command. For example:
dos('start myprogram.exe')