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

80 次查看(过去 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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by