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-abs(t(abs(t)<=T/2))*2/T)*2/T;