×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ButtonDownFnc does not work with the axes

ButtonDownFnc does not work with the axes

ButtonDownFnc does not work with the axes

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources