A matrix-based method for the structural analysis of diagrid systems