Decaying exponential function plot

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)

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeParticle & Nuclear Physics についてさらに検索

質問済み:

2017 年 3 月 17 日

編集済み:

2017 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by