How to set Heaviside function with different values using MATLAB?

10 ビュー (過去 30 日間)
Holli Sharples
Holli Sharples 2021 年 9 月 30 日
回答済み: Walter Roberson 2021 年 9 月 30 日
I need to set the function H(t) = { 4, when 0 </= t < 5; 0, when 5 </= t < 10 (as a unit step function)
We must use the heaviside function for MATLAB to set this function. However, I am not sure how to change the default settings to the parameters I need for this function. I looked through the help link on MATLAB and could not find anything helpful in relation to this exercise. If you could show the process to complete this in really basic steps I would be very grateful. Thank you.

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 30 日
The below is deliberately incomplete and deliberately different than exactly what you are asked for. Study the technique and use it to construct your own function.
syms t
H(t) = 3 - 2*heaviside(t-2)
H(t) = 
fplot(H, [0 5]); ylim([-1 4])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by