From: Paul on
I have a script that asks for user input via a call to the "input" function. I would like to to programmatically supply this input when the script is called. While it would be simple to modify the script, I would like to avoid changing because it is a third party script that frequently changes. The way it is used does not change.

Any ideas?
From: Walter Roberson on
Paul wrote:
> I have a script that asks for user input via a call to the "input"
> function. I would like to to programmatically supply this input when
> the script is called.

Java "robot" class should handle that.
From: Paul on
Walter Roberson <roberson(a)hushmail.com> wrote in message <huov77$ijj$2(a)canopus.cc.umanitoba.ca>...
> Paul wrote:
> > I have a script that asks for user input via a call to the "input"
> > function. I would like to to programmatically supply this input when
> > the script is called.
>
> Java "robot" class should handle that.

I expect you're right, but I was hoping for a "pure Matlab" solution.
From: Walter Roberson on
Paul wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <huov77$ijj$2(a)canopus.cc.umanitoba.ca>...
>> Paul wrote:
>> > I have a script that asks for user input via a call to the "input" >
>> function. I would like to to programmatically supply this input when
>> > the script is called.
>>
>> Java "robot" class should handle that.
>
> I expect you're right, but I was hoping for a "pure Matlab" solution.

Is *all* of the input pre-determined? If so, then you could run matlab itself
in -nodisplay mode with input redirected from a file

matlab -nodisplay -r "StartMe; quit" < InputFileName

From: Steven Lord on

"Paul " <pgottschalk(a)pixel-velocity.com> wrote in message
news:huouol$67f$1(a)fred.mathworks.com...
>I have a script that asks for user input via a call to the "input"
>function. I would like to to programmatically supply this input when the
>script is called. While it would be simple to modify the script, I would
>like to avoid changing because it is a third party script that frequently
>changes. The way it is used does not change.
>
> Any ideas?

Write an "interface" function that calls INPUT, gets the data, and calls the
main workhorse function. That way you can either call the INPUT-based
interface or the main workhorse function directly depending on whether you
want interactive input or not.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com