MATLAB: How to get the rightmost root in the interval

fzeroroot

There is a function (y=@(x)…) of the form shown in the figure, which has exactly two roots in a given interval.
How to get the largest root in the interval?
One way is to first find the minimum of a function using fminbnd to then divide the interval into 2 parts and to search in the right part of the interval using fzero.
How to do this without calling fminbnd (to minimize computer time)?

Best Answer

How about finding the intersection points of the given curve and the line y = 0 ? You can use this to get intersection points.