ezplot is plotting a blank plot
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
no errors nut plot is blank
syms y(x)
a=2;
b=6;
c=1;
d= 8;
e = 6;
ode = diff(y,x) == (-d*x)/(e*y);
ysol = vpa(dsolve(ode))
ezplot(ysol(1))
hold on
ezplot(ysol(2))
0 comentarios
Respuestas (3)
Mark Sherstan
el 12 de Dic. de 2018
You need to solve for your constant C2 otherwise your function is no longer in terms of just x which is a requirment of ezplot.
2 comentarios
Cris LaPierre
el 12 de Dic. de 2018
Editada: Cris LaPierre
el 12 de Dic. de 2018
You did not try to plot the solution that contains constant C5 (ysol(4)). Your plots are for
- 0
- 2x
- -2x
Cris LaPierre
el 12 de Dic. de 2018
Editada: Cris LaPierre
el 12 de Dic. de 2018
You equation has two variables. You need to provide a value for
for ezplot to be able to plot the functions.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/198901/image.png)
Also, best to heed the warnings in the documentation - use fplot instead of ezplot.
If I use fplot and substitute in a value for C2, your code works.
...
ysol = subs(ysol,'C2',25)
fplot(ysol(1))
hold on
fplot(ysol(2))
0 comentarios
Brenda Galabe
el 12 de Dic. de 2018
1 comentario
Cris LaPierre
el 12 de Dic. de 2018
I didn't realize you were using an older version of MATLAB. The behavior will be different. Use ezplot for now.
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!