Surprisingly, no one has yet suggested using a function designed for this in Matlab. Use fzero here. In any case, Fzero is a better choice than fsolve, which requires an optimization toolbar. And, yes, you could do this using the Newton method or even bisecting or secant method. But reinventing the wheel is not something that needs to be done in general. Use the functionality that already exists when it is.
The problem is to find the point where
sin(2*x) == log(x)
log (x) . , , .
fun = @(x) sin(2*x) - log(x);
, . ezplot .
ezplot(fun)
, 1 2.
fzero(fun,2)
ans =
1.3994
user85109