Can I use one Matlab code to input into an input box of another Matlab code?

I was wondering if I could have Matlab code A input values into Matlab code B when code B asks for a input?
In other words, I want to have one Matlab code A to analyze other Matlab codes (B, C, ...) with predetermined values when codes (B, C, ...) request inputs. Is that possible?

Answers (2)

If they are running completely separately you would need to use Java Robot.
If you have two GUI that are cooperating in the same MATLAB session, one GUI's code can manipulate the handles belonging to the other GUI.
Well I want the first one to also automatically open the other codes and execute them. Is that also possible?

2 Comments

Please click on "Comment on this Answer" instead of creating a new Answer.
Java Robot is fine for the case where MATLAB is used to start a new executable and control it.
For the case where you have cooperating MATLAB GUI, the kind of situation where you would have difficulty would be if the second routine was busy computing something and not paying attention to clicks, but you wanted to be able to control the first routine anyhow. But in the case where the second routine is waiting for interaction, then Yes, in the majority of cases the first routine could control it.

Sign in to comment.

Tags

No tags entered yet.

Asked:

on 19 Nov 2013

Commented:

on 19 Nov 2013

Community Treasure Hunt

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

Start Hunting!