Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ButtonDownFnc does not work with the axes

Status
Not open for further replies.

opat

Computer
Oct 20, 2005
1
Hi all, I have a problem while using ButtonDownFnc callback with an axes. I want to read the value of the plot and send it to editText field when I press mouse button over the plot. I am using this code in:

function axes2_ButtonDownFcn(hObject, eventdata, handles)

handles.Z = eval(handles.wzor1); %it reads the equation which I'm ploting
ac_exec =get(gcbo,'parent'); %it gets the parent object of actual callback
xy=get(handles.ac_exec,'CurrentPoint')
z=interp2(x,y,Z,xy(1),xy(2))
handles.zamieniony= num2str(handles.z);
set(handles.akt_wartosc_edit, 'String', handles.zamieniony);

The plot the GUI making participate two simple plots. I make them by a contour function. Maybe they change values of some important variables needed by a ButtonDownFnc?? Unfortunatly I don't know for sure.

Please help me with it.

PS Sorry, for my English, I don't know it well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor