im trying to plot this function, y= (exp(1i.*k​.*pi./10).​*(1-exp(-1​i.*k.*2.*p​i)))./(20.​*(-1+(exp(​1i.*k.*pi.​/10))));

1 回表示 (過去 30 日間)
amin yasin
amin yasin 2021 年 12 月 29 日
回答済み: Paul 2021 年 12 月 29 日
syms y k
y= (exp(1i.*k.*pi./10).*(1-exp(-1i.*k.*2.*pi)))./(20.*(-1+(exp(1i.*k.*pi./10))));
fplot(y)
  2 件のコメント
amin yasin
amin yasin 2021 年 12 月 29 日
i dont know why this do not work,
i would love to have some help.
thanks in advance
Torsten
Torsten 2021 年 12 月 29 日
Does this work ?
syms x y(x)
y(x) = (exp(1i.*x.*pi./10).*(1-exp(-1i.*x.*2.*pi)))./(20.*(-1+(exp(1i.*x.*pi./10))));
fplot(abs(y(x)),[-5 5])

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

回答 (1 件)

Paul
Paul 2021 年 12 月 29 日
syms y k
y= (exp(1i.*k.*pi./10).*(1-exp(-1i.*k.*2.*pi)))./(20.*(-1+(exp(1i.*k.*pi./10))));
y is complex valued, e.g.
subs(y,k,0.1)
ans = 
I'm not sure what fplot() tries to do with a complex valued function. But the real questions is what plot is desired. Perhaps the magnitude of y?
fplot(abs(y))

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by