matlab gui - getting clicked position variables

edited August 2008 in Science & Tech
Hello
I have a problem with matlab gui. I want to get the position of click (on axis) and to draw a point there. Everything is ok if it is blank axis. When there is an image shown in it, all is not working.

The code: Main programme
h = figure(4)
uklad = newplot;

A = imread('car1.jpg');

% imagesc(A); %"turns on" the image


hold on;
set(uklad,'ButtonDownFcn','Click');
Function in a file Click.m

function Click

p = get(gca,'CurrentPoint')
plot(p(1,1),p(1,2),'o-');
drawnow;


Help. How to do the same with the picture shown
yohn(at)interia.pl
Sign In or Register to comment.