function t_mat = poly_mat(tt, dgr, N)
t_mat = ones(dgr,N);
if dgr > 1
  t_mat(2,:) = tt;
  for k=3:dgr
    t_mat(k,:) = t_mat(k-1,:) .* tt;
  end
end
