fplot shows no output
Mostrar comentarios más antiguos
I'm trying to solve a simple differential equation, which works with no problem, but when trying to plot it only ezplot seems to be working, no luck with fplot
syms y(t)
a = 1;
b = 10;
D = diff(y,t) == -a * y * log(y/b);
C = y(0) == 5;
psolution = dsolve(D,C)
gsolution = dsolve(D)
fplot(psolution)
It's really nothing too fancy but I don't understand what's going wrong. This is the output:

Respuestas (1)
Star Strider
el 25 de Jul. de 2020
Editada: Star Strider
el 25 de Jul. de 2020
Try this:
figure
fplot(real(psolution))
hold on
fplot(imag(psolution))
hold off
grid
set(gca, 'YScale','log', 'Ylim',[min(ylim) 100])
legend('Re','Im')
The rest of your code is unchanged.
EDIT — (25 Jul 2020 at 01:07)
Added plot image:

.
Categorías
Más información sobre Surface and Mesh Plots 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!