Why are there gaps in some of my plots?
Mostrar comentarios más antiguos
Hello
I'm plotting a simple equation that seems to be producing the plot I want but is not displaying a continuous line. Its plotting as some kind of discontinuous step function, whereas, I would it to plot the step as a continuos line. I've tried changing the discretization of y, but that doesn't seem to help. Any other thoughts or suggestions would be greatly appreciated. Thanks in advance!
Here is a simplified version of my code:
x2=0;
D=1.003807*10^-7;
u=0.0077;
y=-0.11:0.0001:0.11;
C=(1/2).*(1+erf(y./(sqrt(4*D*x2/u))));
figure
plot(C,y)
Respuesta aceptada
Más respuestas (1)
You have nans in your data because of this:
x2=0;
D=1.003807*10^-7;
u=0.0077;
y=-0.11:0.0001:0.11;
T = sqrt(4*D*x2/u); % Look at this one!
unique(T) % You are dividing by zero in V
V = y./(T); % Look at this!
unique(V)
C=(1/2).*(1+erf(V));
.
.
So, why is T all zeros? Look at x2....
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!