How to compare exponential numbers with 7-9 digits of accuracy

조회 수: 1 (최근 30일)
theblueeyeswhitedragon
theblueeyeswhitedragon 2018년 4월 30일
댓글: dpb 2018년 4월 30일
I am creating a GUI that allows the user to delete data points from a graph by clicking on them. The method has been working for most types of graphs, but for plots that have X-values expressed in exponential form, for example, 7.371477206897944e+05, the code does not work. Also the data range is 7.371476 e+05 to 7.371478 e+05, which makes the elements' X-values really close to each other.
V = event.IntersectionPoint(1:2);
V(1) = V(1);
V(2) = round(V(2),2);
ChosenPointScatter = scatter(V(1), V(2), 'markerfacecolor', 'k', 'markeredgecolor', 'k','parent', subplotRemoval{2});
indx = find(cell{15}(:,1) == V(1));
indy = find(cell{15}(:,2) == V(2));
Basically, I am trying to find the matrix index numbers for the element that equals 7.371477206897944e+05, but I get an empty value for every data point I select. Can you suggest any method for comparing exponential numbers like the one presented?

채택된 답변

dpb
dpb 2018년 4월 30일
doc ismembertol
  댓글 수: 2
theblueeyeswhitedragon
theblueeyeswhitedragon 2018년 4월 30일
편집: theblueeyeswhitedragon 2018년 4월 30일
Thank you. It was exactly what I was looking for.
dpb
dpb 2018년 4월 30일
It's a hard'un; there's no reason to think of that name for the purpose and there are very few links from places one might be in the documentation pointing to it...took me almost two years before I could reliably think of what it was named when wanted it.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by