필터 지우기
필터 지우기

getting x values by clicking on axes

조회 수: 3 (최근 30일)
Haykush
Haykush 2013년 5월 4일
Hi all!
I have the set of (x,y) data:
x=[4 10 25 30 37 45 58 77 81 89 93 100 113 122 130 137 145 152 160 163]; y=[15 24 7 45 35 58 71 22 64 10 21 35 67 50 59 63 77 43 40 5];
After plotting it, I want to be able to get x values in t vector by clicking on the axes.
How can i do it?
  댓글 수: 2
per isakson
per isakson 2013년 5월 4일
Why clicking on the axes? Why not by clicking on the curve?
Search for "Data Cursor" in the on-line help.
Haykush
Haykush 2013년 5월 4일
Thanks, I'll try.

댓글을 달려면 로그인하십시오.

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 4일
Click on your plot the add this code
x=get(gco,'xdata')
y=get(gco,'ydata')
  댓글 수: 15
Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 4일
Ok
Haykush
Haykush 2013년 5월 4일
Please, check your e-mail.

댓글을 달려면 로그인하십시오.


Haykush
Haykush 2013년 5월 4일
First of all, thanks so much for your attention.
For example, I need to fix N data by clicking to the x axis. What do you suggest to do in this case?
Thanks in advance.

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by