Matrix-weighted networks for modeling multidimensional dynamics