Path: news.mathworks.com!not-for-mail
From: "Quentin " <quentin_gaudry@hms.harvard.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Closing DOS window from matlab
Date: Wed, 10 Dec 2008 05:24:02 +0000 (UTC)
Organization: Harvard Medical School
Lines: 8
Message-ID: <ghnjph$qog$1@fred.mathworks.com>
Reply-To: "Quentin " <quentin_gaudry@hms.harvard.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1228886642 27408 172.30.248.38 (10 Dec 2008 05:24:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 10 Dec 2008 05:24:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1550906
Xref: news.mathworks.com comp.soft-sys.matlab:506025


Hello all,

I have a quick question and my internet searches haven't quite gotten me a solution yet. Seems like a real common problem.

I am running a .exe file within a for loop in matlab. I need matlab to start and stop this file each loop iteration. I can get matlab to run the code using !program.exe & and then have matlab close the program by sending a command to that programs via dde. The only problem with this is that the & command (which I need to give matlab access to the dde library) opens up a DOS window with each loop iteration. I need to do many loops so I would like a way to automatically close these windows within matlab. Anyone have an .m file or know of any commands I can use?

Thanks a ton!
quentin