how to solve tan(x)=x

 Accepted Answer

tanxx = @(x) tan(x)-x;
for a = -1:1
xs = fzero(tanxx, a)
end

More Answers (1)

Use the below code with vpasolve,
syms x
for n = 1:100
x1 = (2*n-1)*pi/2;
x2 = (2*n+1)*pi/2;
v(n) = double(vpasolve(tan(x)-x == 0,x,[x1 x2]));
end

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!