% % Unit Rect Function % function Cr = crect(t,L) rise = 0.5*(1 + sign(t+L/2)); rise(find(rise==0.5))=1; fall = -0.5*(1 + sign(t-L/2)); fall(find(fall==-0.5))=-1; Cr = rise+fall; end