Heaviside function in simulink

3 ビュー (過去 30 日間)
Marko Boskovic
Marko Boskovic 2021 年 2 月 8 日
コメント済み: Marko Boskovic 2021 年 2 月 8 日
How to generate this function in Simulink (Matlab code):
20.*t.*heaviside(t) - 40.*(t-10).*heaviside(t-10) + 20.*(t-(680)).*heaviside((t-(680)));

採用された回答

Walter Roberson
Walter Roberson 2021 年 2 月 8 日
If you are in a MATLAB Function Block then
heaviside = @(x) x >= 0;
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 2 月 8 日
function y = fcn(t)
y = zeros(size(t));
heaviside = @(x) x >= 0;
y = 20.*t.*heaviside(t) - 40.*(t-10).*heaviside(t-10) + 20.*(t-(680)).*heaviside((t-(680)));
end
Marko Boskovic
Marko Boskovic 2021 年 2 月 8 日
Thank you Walter!

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by