Using solve to solve a complex trigonometric equation

i have trouble solving the trigonometric equations, and i really don't know what the problem is. Please look at my code and point out if i were wrong or not. Thank You
(I'm using 2019b version)
>> syms x
>> assume(0 <= x <= 2*pi)
>> solve (sin(x)*cos(x) == 0) %%%What's wrong with this result,,,, i really can't get it
ans =
0
>> solve (sin(2*x) == 0)
ans =
0
pi
2*pi
pi/2
(3*pi)/2

 采纳的回答

The solve function works best with simplified expressions, since it does not simplify them by default:
syms x
assume(0 <= x <= 2*pi)
Eq = sin(x)*cos(x);
Eq = simplify(Eq, 'Steps',500);
solve (Eq == 0)
produces:
ans =
0
pi
2*pi
pi/2
(3*pi)/2
.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by