m = {10, 20, 30}nref = {1, 2, 3}a = Table[m + n, {n, nref}] //生成矩阵b = Table[a[[x, x]], {x, 1, 3, 1}] //获取a矩阵对角线元素