Hello. I have an image loaded onto an axes component in GUIDe and I want the mouse location over the squares to drive an xystage to a positon
All I need to return is which column is selected when the mouse if over a particular square: i.e just considering 1D (i.e. columns), if after pressing the mouse, the x coordinate is between 13 & 39, then report column1 (or just 1). If the x coordinate is between 88 and 114, then report back 3. In reality I have 12 columns so am looking a) for the best way to do this, and b) the best way to define the edges (the values of which I have)
This is my mouse click function
function mouse3Callback(src, eventData)
handles = guidata(src);
axesHandle=get(src,'Parent');
xyz=get(axesHandle,'CurrentPoint');
x = round(xyz(1,1))
y = round(xyz(1,2))
that I assign to the axes holding the image (axes3) Button down fucntion:
set(handles.axes3, 'ButtonDownFcn', @mouse3Callback),
Thnaks for any help