Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

How to register where the mouse button is pressed?

Asked by Teemu on 21 Feb 2013

Hi! I have picture and I want to know where the mouse button is pressed. For example in picture there are some objects and I want to know if I press a button on the object. How can I do it? I appreciate your help.

0 Comments

Teemu

Products

No products are associated with this question.

1 Answer

Answer by Sean de Wolski on 21 Feb 2013
Accepted answer

Set The object's ButtonDownFcn to register the event and get the axes' 'CurrentPoint' if you need more information about where. I recommend getting started here:

http://blogs.mathworks.com/videos/2011/03/29/graphics-challenge-for-new-users/

0 Comments

Sean de Wolski

Contact us