function z=ktriw(x,y)

% KTRIW       Tri-weight Kernel Function for univariate data.

if nargin==1,
  z1=35*((1-x.^2).^3)/32;
  z=z1.*(abs(x)<1);
  elseif nargin==2,
    z=ktriw(x).*ktriw(y);
end;