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

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

displaying values

Asked by FIR on 24 Feb 2012

I have a sine wave,in which i have take positive curve(upper curve), now if i click anywhere in that graph i want to display values of x,y,using gui ,please help

0 Comments

FIR

Products

No products are associated with this question.

1 Answer

Answer by Oleg Komarov on 24 Feb 2012
Accepted answer

You can use datacursormode to display datatips.

Check the examples.

EDIT the simplest example

function myGUI
figure('menubar','none','name','myGUI','numbertitle','off','resize','off');
plot(1:10)
datacursormode
end

5 Comments

FIR on 27 Feb 2012

Oler i am new to this gui,if i type these in command window i get error ,please help

FIR on 27 Feb 2012

Oleg if i click on that grapg where ever on the line and near by the line the values of x and y must be displayed,in each x and y boxes

Oleg Komarov on 27 Feb 2012

You have to save it as a function and then call the function myGUI to see the effect.

Oleg Komarov

Contact us