system command pressing return

조회 수: 6 (최근 30일)
Thomas Kurian
Thomas Kurian 2020년 5월 28일
댓글: Thomas Kurian 2020년 5월 29일
I am trying to run a system command from matlab, but I need to hit enter twice before any output comes out.
If I run it in the command window I can hit enter twice and then I get the output, but I also need to run this from a script as well where I don't want to be press enter. I just want it to continue.
Is there a way to call the system command and specify that I need to hit enter?

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 5월 28일
This trick has worked many times. Try it.
Create a text file called KeyInput.txt, in which you hit return twice and save it. Basically it is a blank text file. Name it differetnly if you want.
Then run system('MyCommand.exe < KeyInput.txt')
  댓글 수: 1
Thomas Kurian
Thomas Kurian 2020년 5월 29일
Fantastic. Worked like a charm!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by