mathematica取矩阵对角线元素

m = {10, 20, 30}

nref = {1, 2, 3}

a = Table[m + n, {n, nref}]    //生成矩阵

b = Table[a[[x, x]], {x, 1, 3, 1}]    //获取a矩阵对角线元素


你可能感兴趣的:(mathematica取矩阵对角线元素)