function out = rectw(t,tau) % This function is the pulse function symmetric % about 0 with width TAU and height 1/TAU: % % sig = rectw(t,tau), where SIG and T are vectors of the same dimension. % % elements of SIG are either 0 or 1/TAU corresponding to elements of T % whose absolute values are greater than TAU/2 and % those that are less than or equal to TAU/2, respectively. % % % written by Kevin D. Donohue 2/93 % out = zeros(size(t)); % set up output array elm_1 = find((t-tau/2 <= 0) & (t+tau/2 >=0)); % assign zero function values out(elm_1) = (1/(abs(tau)+eps))*ones(size(elm_1)); % assign unity function values