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')

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

태그

질문:

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