How can I create a unit step function u(t) in symbolic function form?

조회 수: 39 (최근 30일)
Hi,
I have an homework in which a part includes a function which is applied to an LTI system. The problem is, the function is desired to be defined as a symbolic function and I did that part easily but it is multiplied with the unit step function u(t) and problem begins here. Normally, I define the unit step with a loop or a simple statement like unitstepsignal = t>=0; but this statement does not respond to the calculation and loops does not respond as well since MATLAB cannot convert symbolic to logical and gives the error message "Conversion to logical from sym is not possible.". I tried the heaviside function but it turns 1/2 when t=0 yet I need 1 for t=0. That is why, it is not useful for the current situation. I'm adding the part that I need and I left unitstepsignal as how it is because I'm really tired of trying. So, thanks in advance for your help about defining u(t).
syms x(t)
syms h(t)
x(t)=44.*exp(3.27.*t).*unitstepsignal; %unitstepsignal is u(t) but I could not define it as symbolic.
h(t)=0.5.*44.*exp(0.5.*3.27.*t).*unitstepsignal;

채택된 답변

Star Strider
Star Strider 2020년 12월 19일
Use the heaviside function.
  댓글 수: 4
Emre Bostancioglu
Emre Bostancioglu 2020년 12월 20일
According to the heaviside page, the value of the heaviside function can be changed at origin by using the sympref function. So, thanks a lot for your help and recommendation.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by