MATLAB Answers


selecting value using ginput

Asked by Lalit Patil on 3 Jan 2013
 data = dlmread('value.txt');
 axis off 
 [x,y,z] = ginput(2)

ginput gives value in command window. I want that value above cursor on image when i select point. So, how to do..?



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 3 Jan 2013


Lalit, impixelinfo most certainly DOES work with color images. I know because I do it all the time. You case here is totally different. You actually don't have an image at all, like you did in your other question. Here you have a rendering of a plot of a few points in 3D - it's not a grayscale or color image in the sense that it's a solid 2D array of numbers. Do you understand the difference?

yes, datacursormode() works.. Now, i want to display that value in command window which i select on image..

Add an axes or lineseries ButtonDownFcn callback (if you add it to axes, be sure to set() 'Hittest', 'off' on all the lines in the axes)

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!