I have a function:
I need to plot it: y(t) = 2f(t-1) + 4f(t-2) + 3(ft-3) + f(t-4)
I could imagine what y(t) looks like but couldn't make the MATLAB code working after a lot of tries. I have:
pt = @(t) (1 ./ (1 + t .^ 2));
But I don't know how to specify the range of t (0.5 >= t >= -0.5).
I also tried piecewise():
pt = @(t) piecewise(0.5 >= t >= -0.5, (1 + t .^ 2) .^ (-1), t > 0.5, 0, t < 0.5, 0);
But it reported error: Undefined function 'piecewise' for input arguments of type 'double'.
Could you please help me with this? Thanks a lot!