Run command-line type external software within a .m matlab

조회 수: 6 (최근 30일)
MM
MM 2014년 4월 30일
답변: MM 2014년 5월 1일
Hi
Is there a way to pass a series of instructions to an external program in a matlab .m script ? It looks like
! appli code
will run the appli program with a first instruction code
What is the syntax to pass along the carriage return and another instruction to further select options for appli ?
  댓글 수: 3
MM
MM 2014년 4월 30일
typically i need first to pass
appli code
then press enter and it will ask me more such as => Continue press 1 Stop press two
the problem is that i need to wait it has run the first instruction batch before passing the further option
dpb
dpb 2014년 5월 1일
Unless one of the options is to switch to file input, that's probably not going to happen successfully.
There are ways (or at least there were w/ DOS) to simulate keypresses but those have pretty much gone the way of the dodo bird w/ later releases.
It's possible to build interactive shells around such with Tcl as the glue or similar.

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

채택된 답변

MM
MM 2014년 5월 1일
In fact, there is a snippet to do that:
TextInject and KeyInject,
Nice Work Phil

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 5월 1일
I think maybe people have used the java robot for that, but I'm not sure. If the program is ActiveX capable, you can use ActiveX.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by