Plotting powered matrices vs ezplot

I've just come across a weird bug (or it's propably just me doing something wrong). I am doing:
ezplot(-x1/(2*(x1^2)^(5/2)),[-5,5])
which produces a fine plot. Then I am trying to do same plot by doing
x=[-5:0.01:5]
y=-x./(2*(x.^2).^(5/2))
plot(y,x)
and the plot is orders of magnitude scaled up, meaning y doesn't go from -0.5 to 0.5 like it should, but from 5*10^7 to -5*10^7. What am I missing here?

 Respuesta aceptada

Stephen23
Stephen23 el 26 de En. de 2016
Editada: Stephen23 el 26 de En. de 2016
>> x=[-5:0.01:5];
>> y=-x./(2*(x.^2).^(5/2));
>> plot(x,y)
>> ylim([-10,10])
The function is discontinuous at x==0, and goes to ± infinity. You are dividing by zero.

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 26 de En. de 2016

Editada:

el 26 de En. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by