function A = antidiag(n) A = zeros(n,n); for j = 1:n i = n + 1 - j; A(i,j) = 1; end end