Help needed plotting very simple equation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sidant Dev
el 18 de Nov. de 2021
Comentada: Star Strider
el 18 de Nov. de 2021
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!
0 comentarios
Respuesta aceptada
Star Strider
el 18 de Nov. de 2021
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!