原文地址:matlab trace函数 求矩阵的迹作者:漂流瓶jz matlab中的trace函数 求矩阵的迹。 矩阵的迹就是矩阵的主对角线上所有元素之和。 >> [1 2;7 10] ans = 1 2 7 10 >> trace(ans) ans = 11