function output=rect(time)
timeleft=time+0.5*ones(size(time));
timeright=time-0.5*ones(size(time));
outleft=0.5*(ones(size(timeleft))+sign(timeleft));
outright=0.5*(ones(size(timeright))+sign(timeright));
output=outleft-outright;