Note on generalized inverses of matrices