필터 지우기
필터 지우기

How to find x,y coordinates.

조회 수: 3 (최근 30일)
Ariane
Ariane 2023년 2월 20일
답변: Sulaymon Eshkabilov 2023년 2월 20일
I have to find x,y coordinates for 3 data points where the slope of my function changes. When I just click on the points, I can see the x,y coordinates but I was wondering if there is a better way to do it that will be more accurate. I created this plot like this plot(distance,T,'-k')
  댓글 수: 2
Torsten
Torsten 2023년 2월 20일
Depends on how the plot was created ...
Torsten
Torsten 2023년 2월 20일
So "distance" and "T" are known arrays of numerical values ?

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

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 20일
(1) Using the data to be plotted
y = @(t)2*t.^2+3*t-5;
t = 0:2:8;
f = y(t);
tnew = 0:.2:8;
y = interp1(t, f, tnew);
figure
plot(t,f, 'k-')
hold on
plot(t,f, 'ro', 'markerfacecolor', 'y', 'MarkerSize', 9)
xlabel('t')
ylabel('y(t)')
hold off
(2) Graphical and approximate approach is ginput()
y = @(t)2*t.^2+3*t-5;
t = 0:2:8;
f = y(t);
tnew = 0:.2:8;
y = interp1(t, f, tnew);
figure
plot(tnew,y, 'k-', 'linewidth', 2)
N = 4; % Number of data points to be located with ginput()
[xx, yy] = ginput(N);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by