function Y = triu(X,k)
%Y=triu(X,k)
%Upper triangle of X

%       S.Halevy 7/31/92
%       Copyright (c) 1992 by the MathWizards

k=expr_sel(nargin==1,0,k);
[m,n] = size(X);
Y = zeros(m,n);
for j = max(1,1+k):n
   i = 1:min(m,j-k);
   Y(i,j) = X(i,j);
end
