An extension of the GCED matrices from the domain of natural integers to the unique factorization domain is given. The structure of these type of matrices defined on both arbitrary sets and GCED-closed sets are presented. Moreover, we present exact expressions for the determinant and the inverse of such matrices. The domains of Gaussian integers and polynomials over finite fields are used to illustrate the work.