Converting cosine to exponential form

6 ビュー (過去 30 日間)
Andromeda
Andromeda 2021 年 11 月 7 日
編集済み: Andromeda 2021 年 11 月 10 日
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

回答 (1 件)

Jan
Jan 2021 年 11 月 7 日
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 件のコメント
Andromeda
Andromeda 2021 年 11 月 7 日
編集済み: Andromeda 2021 年 11 月 7 日
(-1)^(w*pi) is merely arbitrary but it relates to stationery points of a curve. I am familiar with the forms of cosine and the exponential function that you have provided but that is not what I am looking for.
I am well aware that you can do the following but I want an alternative way of doing it
user_input = cos(3*y); %coefficient of y is 3
result = (-1)^(3*pi) %desired output

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by