Converting cosine to exponential form
Show older comments
I am trying to convert a cosine function to its exponential form but I do not know how to do it.
[more elaboration]
syms w y
function1 = input('user please enter input');
%user input is cos(y)
desired_output = (-1)^(w*pi) if y = w*pi
Answers (1)
Jan
on 7 Nov 2021
1 vote
cos(x) = 0.5 * (exp(1i * x) + exp(-1i * x))
exp(ix) = cos(x) + 1i * sin(x)
I do not understand, why the desired output is (-1)^(w*pi).
1 Comment
Categories
Find more on Linear Algebra 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!