フィルターのクリア

How to graph functions over time with a delay using MATLAB?

2 ビュー (過去 30 日間)
Jonathan Hollingsworth
Jonathan Hollingsworth 2020 年 9 月 4 日
回答済み: Sokna San 2022 年 12 月 17 日
I am struggling to graph a function over time with a delay using MATLAB. I have two examples listed below:
  • Ex1) x(t) = -10e^-.1t u(t) for which my code looks like:
t = 0:.1:100;
x = -10*exp(-.1*t);
plot(t,x,'linewidth',2)
  • Ex2) x(t)=-10e^-.1t u(t-5)
I am not sure how to incorporate the (t-5) into my code. What is the proper procedure to include this parameter in the graph?
Any and all help is appreciated! Thank you!

回答 (2 件)

Asad (Mehrzad) Khoddam
Asad (Mehrzad) Khoddam 2020 年 9 月 4 日
You can use:
-10*exp(-.1*t).*(t>=5);
  1 件のコメント
Jonathan Hollingsworth
Jonathan Hollingsworth 2020 年 9 月 4 日
Thank you sir. That was very helpful.

サインインしてコメントする。


Sokna San
Sokna San 2022 年 12 月 17 日
t =0:.1:100;
x =-10*exp(-.1*t);
subplot(2,2,1)
plot(t,x,'linewidth',2)
x1=-10*exp(-.1*t).*heaviside(t-5);
subplot(2,2,2)
plot(t,x1,'linewidth',2)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by