Plot interval for inverse cos

1 回表示 (過去 30 日間)
Orennia Goetzinger
Orennia Goetzinger 2020 年 3 月 5 日
I'm trying to plot a ratio that's periodic, so every 2pi radians, the function value should be one. The plot I'm getting shows a value much closer to zero however, so I assume I need to adjust the interval I'm plotting over, but I'm not sure how to do that or what the proper interval would be. What's the right way to approach integer values of 2pi such that my plot is accuracte and the function value is one at these places?
The plot I'm getting looks like this:
And it should look like this:
x=linspace(0,5*pi)
y3=(1-0.5)^2./(1+0.5^2-2*0.5*cos(x))
y4=(1-0.9)^2./(1+0.9^2-2*0.9*cos(x))
y6=(1-0.99)^2./(1+0.99^2-2*0.99*cos(x))
plot(x,y3,x,y4,x,y6)

採用された回答

the cyclist
the cyclist 2020 年 3 月 5 日
Instead of the default value, increase the number of points used in linspace. For example,
x=linspace(0,5*pi,1000)
  1 件のコメント
Orennia Goetzinger
Orennia Goetzinger 2020 年 3 月 5 日
Thank you!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by