how to plot periodic function

13 ビュー (過去 30 日間)
iz
iz 2018 年 5 月 14 日
回答済み: Ameer Hamza 2018 年 5 月 14 日
I have difficult with plotting a periodic function.
the function is : x(t)= exp(-abs(t)) ,-8<=t<=8 ,0 else
T=50 , (f(8)=f(58))
I succeed to plot the function exp(-abs(t)). But i don't know how to make the range -8<=t<=8 and else 0, and how to make the function periodic.
Thanks for help.

回答 (1 件)

Ameer Hamza
Ameer Hamza 2018 年 5 月 14 日
Try something like this
t = -25:0.1:25;
index = t<8 & t>-8;
y = exp(-abs(t));
T = 50;
t_ = [t-2*T t-T t t+T t+2*T];
y_ = [y y y y y];
plot(t_, y_)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by