Find all points of intersection between two functions
Afficher commentaires plus anciens
syms x
ezplot(@(x)x^6 ,[-10,10,-10,10])
hold on
ezplot(@(x)3^x ,[-10,10,-10,10])
hold off
I have functions f(x) = x^6 and g(x) = 3^x. I made the graph of two functions, but is there any ways that I can find all points of intersection between two functions?
Réponses (1)
Star Strider
le 17 Fév 2019
There are only 2 real intersection points. To find them, you simply need to find out the x-values where the functions equal each other, or equivalently where the difference between them is 0:
intsx = solve(x^6 == 3^x , x)
or:
intsx = solve(x^6 - 3^x == 0 , x)
then:
intsxn = vpa(intsx)
giving the 2 real roots:
intsxn =
1.2593399329995780507387959662256
-0.8550750819209264565809050645918
and 4 complex roots.
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!