Find points of intersection and area between two curves,
Show older comments
Hi all,
Being reasonably new to Matlab I'm stuck on how to find both answers. I can plot the two curves on a graph but don't know how to calculate points of intersection and area between them. The curves concerned are as follows:
y = (3x^2)+2x-10
&
y = sin(5x+c2) when c2=9 (c2 calculated in a previous question)
any advice would be great, thanks!
Accepted Answer
More Answers (3)
Liam Nolan
on 2 Mar 2015
0 votes
1 Comment
Star Strider
on 2 Mar 2015
The ‘xint’ vector has the x-coordinates of the intersections. Since they are common to both curves, you can find the y-values by substituting in either function. In the ‘figure(1)’ plot, I did this with ‘y1(xint)’.
Run my code (copy it and paste it to your MATLAB Editor) to see how it works.
The integral is easy to calculate, using a similar idea to what I did in the fzero call. (I already did it.) Give it a go, and if you have problems, I’ll help you get it running.
Liam Nolan
on 2 Mar 2015
0 votes
2 Comments
Torsten
on 2 Mar 2015
Did you even take a look in Start Strider's code ?
xint(1) and xint(2) are the intersection points of the two curves.
Best wishes
Torsten.
Star Strider
on 2 Mar 2015
Thank you, Torsten.
Categories
Find more on Exploration and Visualization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!