Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Lorenzo

Posts: 2
Registered: 3/12/14
Re: How to run exe. file from matlab without mannually entering the input
Posted: Mar 12, 2014 5:46 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

TideMan <mulgor@gmail.com> wrote in message <cb07992f-b851-4554-bd8d-b318689134d3@googlegroups.com>...
> On Friday, July 12, 2013 11:56:07 AM UTC+12, Mehdi wrote:
> > "Steven_Lord" <slord@mathworks.com> wrote in message <krmg14$ncs$1@newscl01ah.mathworks.com>...
> >

> > >
> >
> > >
> >
> > > "TideMan" <mulgor@gmail.com> wrote in message
> >
> > > news:ab0468cd-da2d-46c1-b630-ddb875dad5a9@googlegroups.com...
> >
> > > > On Thursday, July 11, 2013 6:29:07 PM UTC+12, Mehdi wrote:
> >
> > > >> TideMan <mulgor@gmail.com> wrote in message
> >
> > > >> <727c894e-fbe8-4ad5-861a-5ef52405f9e9@googlegroups.com>...
> >
> > > >>
> >
> > > >> On Thursday, July 11, 2013 3:45:08 PM UTC+12, Mehdi wrote:
> >
> > >
> >
> > > *snip*
> >
> > >
> >
> > > > Well, you didn't follow my instructions, did you?
> >
> > > > Read the 2nd paragraph of my last post again and follow my instructions to
> >
> > > > the letter.
> >
> > > >
> >
> > > > BTW, this has nothing to do with Matlab.
> >
> > > > You should be able to do it in a DOS window by typing
> >
> > > > C:/Mysoftware/Myprogram.exe < ControlFile.ctl
> >
> > >
> >
> > > This documentation from Microsoft's website says Windows XP, but I believe
> >
> > > the information it contains applies for later versions of Windows as well
> >
> > > (at least Vista and Windows 7; not sure about Windows 8 but I'd guess it
> >
> > > will work there too.)
> >
> > >
> >
> > > http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true
> >
> > >
> >
> > > --
> >
> > > Steve Lord
> >
> > > slord@mathworks.com
> >
> > > To contact Technical Support use the Contact Us link on
> >
> > > http://www.mathworks.com
> >
> >
> >
> > Thank you Steve! I never knew anything about control files, redirection operators etc.
> >
> > My windows is 7. I tried all the options (<, >,<<, >>, <&, >&,|) but still it doesn't work. I'm really frustrated. I'm using:
> >
> > system('C:/myfolder/myprogram.exe < C:/myfolder/for005.dat');
> >
> > So what am I missing here?
> >
> > Thank you again.
> >
> > Mehdi

>
> You're frustrated?
> What about me?
> I keep telling you what to do, but you completely ignore what I say.
>
> I'll try once more in language a 5-year-old would understand.
>
> 1. Open a DOS window
> 2. Type:
> notepad ControlFile.ctl <Enter> this means you must hit the key with Enter on it
> 2a Type:
> C:/myfolder/for005.dat <Enter>
> 2b Click the wee cross at the top right corner of the window and when it asks if you want to save, click Save.
> 3. At the DOS prompt type:
> C:/myfolder/myprogram.exe < ControlFile.ctl <Enter>




Dear Steve,
I read your advices but I wasn't able to make my program run. I have a similar problem, I have a code called Codes.exe which use 3 input files. When I make it run, normally it ask me some information that I have to give it using keyboard. First of all the code starts with a "Fortran Pause" so I have to give it a "return". Then I have to write
"1" to decide the type of the analysis
"file" to give it the name of the first file it has to use
"0" to give to the code the filter to performance te simulation
....and so on.
Following your advices, I wrote a input.txt files containing:
"
1
file
0
..."

and I made the codes run using system(['Codes.exe<',input.txt]).
I also tried in DOS writing D:\...\Codes.exe<D:\...\input.txt
but I received the error
"forrtl: severe (24): end-of-file during read, unit -4, file CONIN$
Image PC Routine Line Source
Codes.exe 0050F329 Unknown Unknown Unknown ".
I tried to write as you suggested
> 1. Open a DOS window
> 2. Type:
> notepad ControlFile.ctl <Enter> this means you must hit the key with Enter on it
> 2a Type:
> D:/.../input.txt <Enter>
> 2b Click the wee cross at the top right corner of the window and when it asks if you want to save, click Save.
> 3. At the DOS prompt type:
> D:/.../Codes.exe < ControlFile.ctl <Enter>

but it opens the txt file and if I close it, the code can't go out of the Fortran Pause.

I really don't know how to make it works becouse I think I followed everything you wrote. It would be a pleasure for me if you may help me. Thanks a lot!!

Lorenzo




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.