I want to plot:
y = x / (1+x^2)
Why does my output look like this? My code is within the screenshot as well.
Any help is greatly appreciated!

 채택된 답변

Star Strider
Star Strider 2021년 11월 18일
It looks like that because only part of the function is visible in that plot.
A ‘zoomed in’ part of the plot reveals it to be continuous with a minimum at (-1, -0.5) and a maximum at (+1, +0.5) so there is nothing at all wrong with it.
f = -500 : 0.1: 500;
Y = f ./ (1 + f.^2);
figure
plot(f, Y)
grid
xlim([-3 3]) % X-Axes 'Zoomed' Around Origin
Experiment to explore it further.
.

댓글 수: 2

Sidant Dev
Sidant Dev 2021년 11월 18일
This is what I suspected, thank you!
Star Strider
Star Strider 2021년 11월 18일
As always, my pleasure!
.

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

추가 답변 (0개)

카테고리

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

제품

태그

질문:

2021년 11월 18일

댓글:

2021년 11월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by