Hello,
I would like to run a program outside of Matlab, and I have been able to start the program using
system('MYPROGRAM.EXE')
However, when the program has completed running, it prints a success message to the Command Window: "Run completed successfully. Press Return to continue."
I would like to automate this process so that I don't have to manually hit Enter every time the program is called. I am aware of the & option to make the Matlab code continue running; however, MYPROGRAM requires the Return in order to print the output (to text file) that I need.
Any help would be appreciated. (I am using Windows, if that matters.)
Thank you!

 채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 10월 30일

1 개 추천

try system('MYPROGRAM.EXE < MyInput.txt') where MyInpu.txt is a text file you created ahead of time. The text file contains nothing but a return.

댓글 수: 3

Shari
Shari 2011년 10월 30일
Perfect! Thank you so much; I never would have figured this out on my own.
John
John 2015년 8월 24일
편집: John 2015년 8월 24일
Many thanks from me too! Had just the same problem (apparently some years later) and took me forever to find this simple yet clever solution of yours!
Can you send a program through MYPROGRAM.EXE and then do < MyInput.txt?

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

추가 답변 (0개)

태그

질문:

2011년 10월 30일

댓글:

2016년 9월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by