I'm helping out with grading in a Matlab course this summer and one of the assignments consists of building a simple user interface for plotting functions and altering their appearance. All the input is done to the command-line, so the menus look something like:
=====================
1. New function
2. Change line-width
3. Change line-style
=====================
I always start out testing the same way when grading to test basic functionality:
1, 2, sin(x) (create a graph of sin(x) in window 2)
1, 3, exp(x) (create a graph of exp(x) in window 3)
2, 3, 2 (change the line-width of plot number 3 to 2)
3, 2, -- (change the line-style of plot number 2 to dashed)
etc.
Since the majority of hand-ins follow the same suggested menu structure it would make my life easier if there was a way to automatically do these inputs with a script instead of repeating the same sequence of numbers and letters over and over. The script itself doesn't have to be in Matlab although I'm guessing it would be practical since I need to check the resulting graphs manually (i.e. I need the input to be entered into the Matlab-command line).
Basically I want Matlab to read the keystrokes "1 [enter] 2 [enter] sin(x) [enter] ..." to the command-line while running another Matlab-script.
Any ideas?