Heaviside function in simulink
조회 수: 5 (최근 30일)
이전 댓글 표시
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)));
댓글 수: 0
채택된 답변
Walter Roberson
2021년 2월 8일
If you are in a MATLAB Function Block then
heaviside = @(x) x >= 0;
댓글 수: 2
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 General Applications에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!