MATLAB Answers


How to use an impoint?

Asked by Pani
on 19 Jul 2013

I want to use impoint in the gui that I've created, but I don't know how should I do that. There is a part in my gui that the user should be able to choose 2 pixel on the loaded image and then the program runs another function with the coordinates of those 2 pixels. I want also that the program updates the coordinates when the user changes that points.


1 Answer

Answer by Chad Gilbert
on 19 Jul 2013

See help ginput. A minimal working example:

    [x,y] = ginput(1);
    % User clicks a value.
    x = floor(x);
    y = floor(y);


on 19 Jul 2013

No, my problem is that the points are not draggable!

on 19 Jul 2013

When I'm using impoint() the points are draggable. Is there some way you can post a sample of your code?

on 19 Jul 2013

I did, in my first comment

Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!