Decaying exponential function plot

13 views (last 30 days)
Joshua Tobin
Joshua Tobin on 17 Mar 2017
Edited: Star Strider on 17 Mar 2017
I want to plot an exponential function that approaches 1, then decays to zero. I have tried the script below. The function approaches 1 but does not decay. What have I done wrong?
Many Thanks! JMT
t = 0:0.1:10;
y = 1 - exp(-t);
if t>5
y = exp(-t);
end;
plot (t,y)

Answers (0)

Categories

Find more on Particle & Nuclear Physics 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!