<abstract><p>In a recent paper, a new method was proposed to find the common invariant subspaces of a set of matrices. This paper investigates the more general problem of putting a set of matrices into block triangular or block-diagonal form simultaneously. Based on common invariant subspaces, two algorithms for simultaneous block triangularization and block diagonalization of sets of matrices are presented. As an alternate approach for simultaneous block diagonalization of sets of matrices by an invertible matrix, a new algorithm is developed based on the generalized eigenvectors of a commuting matrix. Moreover, a new characterization for the simultaneous block diagonalization by an invertible matrix is provided. The algorithms are applied to concrete examples using the symbolic manipulation system Maple.</p></abstract>