Matrix representation of the generators of symplectic algebras. II. The general case with explicit results for sp(6, R)