Run command-line type external software within a .m matlab
Show older comments
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 Comments
dpb
on 30 Apr 2014
Anything the app expects on the command line has to built into the string passed including the \n, etc., etc., ...
Oftentimes the "more simpler" way is to use file redirection if the app understands that option.
MM
on 30 Apr 2014
dpb
on 1 May 2014
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.
Accepted Answer
More Answers (1)
Image Analyst
on 1 May 2014
0 votes
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.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!