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

55 vues (au cours des 30 derniers jours)
Emre Bostancioglu
Emre Bostancioglu le 19 Déc 2020
Commenté : Star Strider le 20 Déc 2020
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;

Réponse acceptée

Star Strider
Star Strider le 19 Déc 2020
Use the heaviside function.
  4 commentaires
Emre Bostancioglu
Emre Bostancioglu le 20 Déc 2020
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.
Star Strider
Star Strider le 20 Déc 2020
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by