MATLAB: How to determine roots of a trigonometric equation like 2x-cosx-2=0

real roots

How to determine roots of a trigonometric equation like 2x-cosx-2=0 ?

Best Answer

fun=@(x)2*x-cos(x)-2;
x0=[0 2];
sol=fzero(fun,x0)
Best wishes
Torsten.