plotting problem: getting empty graph window

I want to draw this
cos(8*pi*x)/(1+x^2) for x in [-1, 1]
but I get empty graph. How can I correct this?

回答 (1 件)

Stephan
Stephan 2020 年 11 月 10 日

1 投票

fun = @(x) cos(8*pi.*x)./(1+x.^2)
fplot(fun,[-1, 1])

2 件のコメント

Zeynep Toprak
Zeynep Toprak 2020 年 11 月 10 日
thanks a lot
Stephan
Stephan 2020 年 11 月 10 日
編集済み: Stephan 2020 年 11 月 10 日
fplot(fun,[-1, 1],'-.g')
or:
x = linspace(-1,1,500);
y = fun(x);
plot(x,y,'.g')

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

カテゴリ

タグ

質問済み:

2020 年 11 月 10 日

編集済み:

2020 年 11 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by