How can I find the intersection point between 2 graphs?

Hi guys,
I would kindly like your help on how to find the intersection point between the yellow and blue line (at x=800), as shown below. It's probably very easy to solve, but I really have no clue how to get around this.
preview.JPG
My code looks like this:
x = [0:10:5000]
y = Xumix1
g = Xumix2
k = [800 800]
l = [-5e6 4e6]
plot(x,y,x,g,k,l),xlabel('T'),ylabel('U'), legend('Umix1','Umix2')

 채택된 답변

Star Strider
Star Strider 2018년 12월 8일
Use the interp1 function:
x = [0:10:5000];
Xumix1 = 0.12 * x.^2; % Create Data
Intersect_y = interp1(x, Xumix1, 800)
Intersect_y =
76800
I guessed at a function fo ‘Xumix1’ to illustrate the idea.

댓글 수: 2

That's amazing! ! Thank you so much :)
Intersect_y= interp1(x,y, 800)
Intersect_x= interp1(g,x,4500)
Intersect_y =
3.7837e+05
Intersect_x =
4.1946e+03
My pleasure!
If my Answer helped you solve your problem, please Accept it!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

2018년 12월 7일

댓글:

2018년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by