Finding intersection points of two lines?

11 Ansichten (letzte 30 Tage)
youngjin cho
youngjin cho am 10 Okt. 2017
Beantwortet: Image Analyst am 10 Okt. 2017
Do you know how to get those intersections btw two lines? the actual intersection points.. I have x from 0 to 40 and y from 0 to 100 which are divided 3600 points.
figure, plot(Stroke,Force);
hold on
coe = polyfit([3.8780 6.8480], [20.0531 60],1);
a = coe(1); b = coe(2);
y = a*Stroke + b;
y1 = a*Stroke +b + 0.02*b;
grid, plot(Stroke,y1)
ylim([0 100])
this is my code so far, Could you help me, anyone asap?

Antworten (1)

Image Analyst
Image Analyst am 10 Okt. 2017
Compute the absolute differences
absDiff = abs(Force - y1);
Then sort and find out the 3 smallest distances
[sortedDiffs, indexes] = sort(absDiff);
Then look at indexes(1:3)
crossingStrokes = Stroke(indexes(1:3));

Kategorien

Mehr zu 컬러맵 finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!