Command for closing a terminal window from Matlab?

조회 수: 5 (최근 30일)
Elisabeth Wetterlund
Elisabeth Wetterlund 2013년 11월 3일
댓글: Elisabeth Wetterlund 2013년 11월 7일
I have a small Matlab script that calls GAMS. GAMS is run in a separate terminal window and when GAMS has finished the optimisation, the terminal window stays open and the Matlab script continues. This is looped a number of times (sometimes several hundreds) which causes a great number of terminal windows that need to be manually closed. There should be a command that I can put in the Matlab script to send the 'exit' command to the terminal window after GAMS has finished running, but I can't find it.
Would appreciate some help!
Best regards, Elisabeth
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 11월 3일
You will need to show us how you start up GAMS, and you will need to indicate which operating system you are running.
Elisabeth Wetterlund
Elisabeth Wetterlund 2013년 11월 4일
I'm running Windows 7 (enterprise) 64-bit. I'm calling GAMS using the line:
!"C:/GAMS/win64/23.8/gams" model_name.gms &

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 11월 4일
How about not opening another window for it:
system('"C:/GAMS/win64/23.8/gams" model_name.gms');
  댓글 수: 2
Elisabeth Wetterlund
Elisabeth Wetterlund 2013년 11월 4일
I keep getting syntax errors, I've tried a few different options but I'll keep trying! Thanks for the help anyway
Elisabeth Wetterlund
Elisabeth Wetterlund 2013년 11월 7일
Hi again,
No I can't get that to work. Is there a way to send an 'exit' command to the terminal windown instead?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 App Building에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by