Re: Input to external program



I don't know if this old trick can help you.

When you run a dos program which asks for inputs, you can use,

EPDRiv1H.exe <inputs.txt

inputs.txt is a text file, in your case, it contains just one
character 'y' without the single quote.

Try to see if it works for you.

Heather wrote:


Hi,

I am calibrating a model and need to be able to run it over and
over
100's of times from MatLab. I have figured out how to call the
model
from MatLab using dos or ! but the problem is that once the model
starts to run, a question requiring user input pops up in the
command
prompt (it asks if I want to create a certain type of file while
the
model is running y/n). I need to be able to answer "y". How can I
send this input to the command prompt automatically from MatLab
(since
it will happen 100s of times).

I tried using:

dos('EPDRiv1H.exe &') % to call the EPDRiv1H model
dos('y') % to answer 'y' to the question
that
pops up in the command prompt when EPDRiv1H runs

but that does not work since 'y' is not a system command.

Please let me know if you can help!

Thanks,
Heather


.



Relevant Pages

  • Re: Input to external program
    ... When you run a dos program which asks for inputs, you can use, ... 100's of times from MatLab. ... a question requiring user input pops up in the ... send this input to the command prompt automatically from MatLab ...
    (comp.soft-sys.matlab)
  • Input to external program
    ... 100's of times from MatLab. ... a question requiring user input pops up in the command ... send this input to the command prompt automatically from MatLab (since ...
    (comp.soft-sys.matlab)
  • Re: Input to external program
    ... 100's of times from MatLab. ... a question requiring user input pops up in the command ... send this input to the command prompt automatically from MatLab (since ...
    (comp.soft-sys.matlab)
  • Re: run dos in xp
    ... You can change the size of the onscreen characters. ... have the Command Prompt open - it's there. ... Are you sure your old DOS program will run in XP? ... load a legit DOS system on your machine to run it, ...
    (microsoft.public.windowsxp.basics)
  • Re: Continuous data stream from dos executable
    ... Approximately once per second the dos program has a data packet. ... I do not want to place a blocking call using the Matlab dos() command because that will cause the dos executable to load every time and this would be too slow. ... It is much better to have the dos program active in the background, then somehow have an event fire within Matlab and cause a callback function to run every time it has a packet ready. ... There is no Matlab mechanism to open an independently executing process and communicate with it. ...
    (comp.soft-sys.matlab)