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 key press or mouse-button click:
Example:
w = waitforbuttonpress; if w == 0 disp('Button click') else disp('Key press') end
for more information visit: http://www.mathworks.com/help/matlab/ref/waitforbuttonpress.html