Unit step and Ramp together

Hello guys I want help .. I try to draw this signals in the pic attached , but the problem is, When i want to draw the ramp function, it starts on X-axis , but it should start from y=2 as the picture shown .. i attached my code too , any suggestions

4 件のコメント

Seraj Mkb
Seraj Mkb 2022 年 3 月 16 日
Here's the code
Walter Roberson
Walter Roberson 2022 年 3 月 16 日
What does (2 minus ramp) look like?
Seraj Mkb
Seraj Mkb 2022 年 3 月 17 日
Maybe the ramps will continue to -infinity ?
Walter Roberson
Walter Roberson 2022 年 3 月 17 日
Consider:
sympref('HeavisideAtOrigin', 1)
ans = 
syms t
u = @(t) heaviside(t)
u = function_handle with value:
@(t)heaviside(t)
r = @(t) t
r = function_handle with value:
@(t)t
f = (u(t-0)-u(t-1.5)) * (2-r(t))
f = 
fplot(f, [-1 5] ); ylim([-1/2 2.5])
This is not exactly what you need: notice that at 1.5 it still has value 1/2. The plain ramp function has slope 1, and if you look at your graph, you need something with slope (0-2)/(1.5-0) = -4/3. I will leave it to you to figure out how you might get a slope of -4/3 for a ramp.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

製品

タグ

質問済み:

2022 年 3 月 16 日

コメント済み:

2022 年 3 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by