function [x]=triangle(t,T) %function [x]=triangle(t,T) %t may be a vector %x is a triangle; basis: T, height: 2/T x=zeros(1,length(t)); x(abs(t)<=T/2)=1/T;