I want to plot this equation P(t)=P(0)*e^rt.
Show older comments
I want to plot this equation P(t)=P(0)*e^rt. considering P(0) is p nought.
3 Comments
John D'Errico
on 12 Jun 2021
Edited: John D'Errico
on 12 Jun 2021
So what have you tried? Are P0, r and the limits for t all known? Have you considered reading the manual? The MATLAB Onramp tutorial would be a good place to start, as this is basic.
Ibrahim Bin Umair
on 12 Jun 2021
John D'Errico
on 12 Jun 2021
If P0 is not known, then what can you plot, since this is explicitly a function of P0.
Answers (1)
Mouhamed Niasse
on 12 Jun 2021
xlim1=0; xlim2=10;
r=1; P0=1;
% I supposed you will define r and P(0) as constants, and the limits xlim1
% and xlim2 are known:
t=linspace(xlim1,xlim2);
P=P0*exp(r*t);
plot(t,P)
Categories
Find more on Optimization Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!