The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to run exe. file from matlab without mannually entering the input
Replies: 15   Last Post: Mar 12, 2014 12:30 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 14
Registered: 6/1/13
Re: How to run exe. file from matlab without mannually entering the input
Posted: Jul 10, 2013 11:45 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Sorry I just saw your reply.
Can you please elaborate on ControlFile.ctl and what you meant by keystrokes?
What the exe file asks for upon opening is the path of the text file that it reads (where it is saved). In other words, it doesn't ask for variables or parameters.
I'm really desperate. Thank you again for your continued help.

TideMan <> wrote in message <>...
> On Sunday, June 2, 2013 9:16:23 AM UTC+12, dpb wrote:
> > On 6/1/2013 3:13 PM, Mehdi wrote:
> >

> > > Hello folks, I have an executable file (generated from a FORTRAN code)
> >
> > > that I need to run from matlab. Upon execution, it asks for the path of
> >
> > > the input file (C:\...Myprograms\sample.dat) and I have to enter it
> >
> > > manually but I want to do this programmatically, i.e., I want matlab to
> >
> > > get the input automatically and run the exe. I presume the function:
> >
> > > system (C:\...Myprograms\myexecutable.exe) is supposed to do the job but
> >
> > > for some reason it fails. Can anybody help me please? I'd be very grateful.
> >
> >
> >
> > If it uses standard input, you should be able to use command line
> >
> > redirection as part of the command string you submit...
> >
> >
> >
> > --

> In other words, do this:
> system('MyProgram.exe < ControlFile.ctl');
> The "<" tells DOS to use that file, not input from keyboard.
> ControlFile.ctl must contain all the keystrokes that you would use to enter the parameters from the keyboard.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.