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:

Réponses (1)

Star Strider
Star Strider le 25 Juil 2020
Modifié(e) : Star Strider le 25 Juil 2020

0 votes

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:
.

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Produits

Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by