function T = chaingraph(n) T = zeros(n); for i=2:n T(i,i-1) = 1; end T = T + T'; return