fplot shows no output
Show older comments
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:

Answers (1)
Star Strider
on 25 Jul 2020
Edited: Star Strider
on 25 Jul 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:

.
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!