We present a generalized resultant matrix and a fast algorithm for testing the coprimeness of two polynomial matrices, extracting their great common divisor, finding the McMillan degree and the observability indices of the associated minimal realization.