I am writing a program in which at some point a graph is plotted and displayed on screen. The user then needs to press \'y\' or \'n\' to accept or reject the graph. My current s
Wait for buttonpress opens up a figure, which may be unwanted. Use instead
pause('on'); pause;
which lets the user pause until a key is pressed.