how to solve tan(x)=x

7 visualizaciones (últimos 30 días)
huang
huang el 26 de Feb. de 2014
Respondida: Arun Nyamagoudar el 21 de Feb. de 2020
May I ask how to solve tan(x)=x in matlab?

Respuesta aceptada

Star Strider
Star Strider el 26 de Feb. de 2014
tanxx = @(x) tan(x)-x;
for a = -1:1
xs = fzero(tanxx, a)
end

Más respuestas (1)

Arun Nyamagoudar
Arun Nyamagoudar el 21 de Feb. de 2020
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

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by