Find points of intersection and area between two curves,
Mostra commenti meno recenti
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!
Risposta accettata
Più risposte (3)
Liam Nolan
il 2 Mar 2015
0 voti
1 Commento
Star Strider
il 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
il 2 Mar 2015
0 voti
2 Commenti
Torsten
il 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
il 2 Mar 2015
Thank you, Torsten.
Categorie
Scopri di più su Exploration and Visualization in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!