Are you certain you've implemented the formula correctly? Your expected result has a very different value for t = -5 than for t = -3, but none of the logical terms in your code differ in value for t = -5 and t = -3 and none of the numeric terms by which those logical terms are multiplied depend upon t.
For t = -3, your function evaluates to 1-1. The following terms are the only ones that are something times true.
(1).*(t<=1)-(1).*(t<=-1)
For t = -5, your function evaluates to 1-1. The following terms are the only ones that are something times true.
(1).*(t<=1)-(1).*(t<=-1)