provide the matlab code that will exactly locate the two intersectionss between the curves.
Info
This question is closed. Reopen it to edit or answer.
Show older comments
f = @(x) 0.5*x^2 - 3*x + 9; g = @(x) 10*exp(x/10);
if method can be solved using fzero please use that
Answers (1)
Walter Roberson
on 6 Dec 2015
0 votes
That problem cannot be solved. There are three intersections, not two, and the intersections locations are all at irrational (and possibly transcendental) locations. It is therefore not possible to exactly locate the intersections.
You should plot the functions to see that there are three intersections. They are at roughly -1/4, +10, +45
4 Comments
Dan
on 6 Dec 2015
Walter Roberson
on 6 Dec 2015
Even if you consider only the first two roots, it is not possible to locate them exactly.
You should keep in mind for future that when you introduce exponentials into a functions over real numbers that you can expect to get exact solutions only if the linear portion equals 1 (exp(0)) or 0 (exp(-infinity))
Dan
on 6 Dec 2015
Walter Roberson
on 6 Dec 2015
Sometimes teachers think of numeric solutions as "exact" solutions, but numeric solutions are seldom exact solutions.
fzero could certainly be used to get numeric solutions. A key trick here is to give it a range of values that it is allowed to search over, instead of just giving one starting point. See the fzero documentation.
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!