How do I get all solutions of the equation cos(x)==cos(3x) using solve() from Symbolic Math Toolbox ?

5 views (last 30 days)
I’ve tried the following code:
syms x
sol =
par =
cond =
in(k, 'integer')
But I expected to obtain: k*pi/2.
Where am I wrong ? Thanks in advance.

Answers (1)

David Goodmanson
David Goodmanson on 26 Mar 2018
Hi Angelo,
You didn't go wrong, it's missing half of the roots. But this works
go figure.

Community Treasure Hunt

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

Start Hunting!