Need coordinates of endpoints on scatter plot

I have a scatterplot that forms multiple rays and I need to know the coordinates of the points at the ends of each ray.
My code is as follows:
data1 = readtable('600psi_15k_FT.txt');
data2 = readtable('1000psi_10k_FT.txt');
x1=data1.Var1;
y1=data1.Var2;
x2=data2.Var1;
y2=data2.Var2;
[peaks,locs]=findpeaks(y2,MinPeakHeight=0.003,MinPeakProminence=0.0006)
figure;
hold on;
plot(x1, y1, 'b-', 'DisplayName', '600psi');
plot(x2, y2, 'r-', 'DisplayName', '1000psi');
plot(x2(locs), peaks, 'ro', 'MarkerFaceColor', 'r', 'DisplayName', 'Peaks');
legend show;
hold off;
other_peaks = y1(locs);
scatter(peaks,other_peaks);
plot(peaks,other_peaks,'-o')

댓글 수: 3

Consider sharing your data files. You can attach them to your post using the paper clip icon.
dpb
dpb 2026년 1월 28일
Why isn't it just [peaks, other_peaks]?
you can convert your cartesian coordinates in polar (using cart2pol) and use again findpeaks with the radius values

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

릴리스

R2025b

질문:

2026년 1월 28일

댓글:

2026년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by