function out = triw(t,tau) % This function is the triangle function symmetric % about 0 of width 2*TAU and maximum height 1/TAU: % % sig = vt(t, tau), where SIG and T are vectors of the same dimension. % % elements of SIG are either 0 or (1/TAU)*(1-abs(T)/TAU) corresponding % to elements of d whose absolute values are greater than TAU and those % that are less than or equal to TAU, respectively. % % % written by Kevin D. Donohue 2/93 % out = zeros(size(t)); % Initialize output vector % with zeros. elm_1 = find((t-tau <= 0) & (t+tau >=0)); % Find t-axis values for nonzero range out(elm_1) = (1/tau)*(1-abs(t(elm_1)/tau)); % Plug into triange function.