add matrix in RD