Re: Input to external program



Unfortunately this didn't work -not sure why. I starts the model just
fine but then stops at the question and doesn't seem to use the
inputs.txt file?? Any other suggestions?

Thanks!
Heather


Fangjun Jiang wrote:
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
    ... 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
    ... 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)
  • ctrl-C issue
    ... I'm running Matlab in non-Java mode (just a command prompt), ... memory intensive computation. ... when you do ctrl-c you ...
    (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: Importing data from Excel
    ... > I am running Student Version Matlab 6 Release 12 and Windows XP ... > from an open Excel spreadsheet into Matlab and when I enter the ... (Too see your current working directory, ...
    (comp.soft-sys.matlab)