Mathematica
Matlab
Maple
A:=Matrix([[1,2,3],[4,5,6],[7,8,9]]); d:=MTM:-diag(A); add(x,x in d); Another ways LinearAlgebra:-Diagonal(A); Student:-LinearAlgebra:-Diagonal(A);
|
15 |