function z=ktria(x,y)

% KTRIA       Triangular Kernel Function for univariate data.

if nargin==1,
  z1=1-abs(x);
  z=z1.*(abs(x)<1);
  elseif nargin==2,
    z=ktria(x).*ktria(y);
end;