Write a function that clicks on a GUI button.

Description:

Some times one wishes to use Matlab to automate some time consuming repetitive process that requires filling fields or clicking buttons on the screen. Matlab offers a simple way to control the cursor position (e.g. set(0,'pointerlocation',...), but it is not so clear how one would perform mouse or keyboard clicks.

This problem creates a simple message box:

 msgbox('Click the OK button','')

which displays the above message and an 'OK' button.

Your function just needs to actually click on the OK button (or use equivalent keyboard shortcuts) to pass this problem. Simple, right?

Solution Stats

95 Solutions

10 Solvers

Last Solution submitted on Jun 15, 2025

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers10

Suggested Problems

More from this Author33

Problem Tags

Community Treasure Hunt

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

Start Hunting!