Function Input in command window

I am currently attempting to write a function that loops an input of another function. The main function is not mine, and is very long and complicated so I am trying to write a function to open this function and enter the inputs everytime with one input changed. The problem is that the function inputs are inputed in order in the command window so I can open the function in a script but I do not know how to enter the inputs. The function name is Tornado so I can write that in a script to open in.
Here is the code printed to the command window when that script is run:
Input operations.
[1]. Aircraft geometry setup
[2]. Flight condition setup
[3]. Change rudder setting
[4]. Move reference point
Lattice operations.
[5]. Generate lattice.
Computation operations.
[6]. Processor access
Post processing and interactive operations.
[7]. Post processing, Result/Plot functions
[8]. Keyboard access
Auxiliary operations.
[10]. About / Release Info
[100]. Help files
[0]. Exit Tornado
Please enter choice from above:
I attempted to just write in the new script:
Tornado
1
to try and enter the 1st option in the function. I then want to continue to enter inputs in this way. Any help would be appriciated, thank you.

11 Comments

Would need to see the input section for the script to be able to tell for sure -- it looks like it may simply use input in a front end loop; there aren't simple ways to stuff the keyboard input buffer -- ways, but not trivial.
It may be simpler if you're using a particular functionality to find that functionality and create a routine to drive it directly, bypassing the main script.
As said, think only be able to really do anything if you show the code you're trying to drive and specifiy specifically what function(s) you're trying to use.
Jack McNulty
Jack McNulty on 29 May 2022
Edited: Jack McNulty on 29 May 2022
I will try to look at that, although it was not my first option because this function has many nested functions and many different possible outputs depending on what you want and just very complicated in general (I think it is someone's thesis). I don't know how I would use the 'input' function, also I am trying to run the function without having to input anything in the control window, just run it from what I have written in the script.
Thank you
If you are constrained to run the function without modification, then you might use java.awt.Robot (https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html) to generate the keyboard input automatically.
However, it's likely feasible to modify the function you've inherited, such that you can send input arguments rather than taking user-input on the command line via the input function. Then write your own script or function that runs the thing with the required sets of input parameters and collects the results.
I would lean toward the second approach, but I would have to see the code to know how involved the modifications would need to be. Can you upload the code so we can see how complicated it is?
The code is called Tornado, it is free to download if you just lookup MATLAB Tornado. If you could I would greatly appriciate it!
That would fall more under the guise of consulting rather than simply helping with specific Q?,it would seem.
One could at least provide the link and as requested, the specific functionality being looked for.
The above Home page introductory text includes the following "...The code can either be run with a text based interface or in batch mode." but a cursory look through the documentation didn't include anything except using the text interface.
That would seem to imply it may have the facility OP is looking for, but it isn't made patently clear how to use it at least at the top level of any of the links or just what is available in batch mode.
Thank you Walter, and thank you for looking dpb at that. After your overview do you think is would be very difficult to do a batch mode from just altering their code, or does it seem very time consuming, or do you not have enough information?
@Jack McNulty: you should contact the authors of that code, who will be in a much better position to support you.
dpb
dpb on 30 May 2022
Edited: dpb on 30 May 2022
I've not looked at the code at all; I'd suggest given the above about batch mode you delve into the product to find out just what that implies/allows.
Surely there's a user community -- the author seems to still be actively supporting the product either as a side hustle or as his main occupation; there's the place to go for the real skinny.
Here, unless someone who is also a user just happens to see your Q?, there's nobody routinely here that has any experience with the product and it is a forum specifically on how to use MATLAB, not another application that happens to have been built using MATLAB. Also remember this is an all-volunteer forum.
I have emailed the info team of the sight, I will wait for them to get back to me. Appricieate it.

Sign in to comment.

Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 29 May 2022

Commented:

on 30 May 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!