How to find intersection points of a vector-valued curve and a function?

조회 수: 2 (최근 30일)
masoud avaznejad
masoud avaznejad 2020년 12월 16일
답변: Star Strider 2020년 12월 16일
Hello
I have two curves,one has function and another one is just vector-valued matrix
How can I find the cross points between those two?

답변 (1개)

Star Strider
Star Strider 2020년 12월 16일
It is likely easiest to evaluate the function, then interpolate to find the intersection.
Example —
x = linspace(0, 2);
vector = x.^2;
f = @(z) 5./(1 + z);
intx = interp1(f(x) - vector, x, 0, 'linear');
figure
plot(x, vector)
hold on
plot(x, f(x))
plot(intx, f(intx), 'pg', 'MarkerSize',10)
hold off
grid
legend('Vector', 'Evaluated Function', 'Intersection')
.

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by