Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个矩阵形式的数据存储在一个 CSV 文件中,它看起来像这样,
我想让这个 6 * 6 矩阵成为一个对称矩阵,像这样,
如何使用python(或matlab)将n×n矩阵(方阵)变为对称矩阵?或者有其他工具可以做到吗?</p>
请给我任何建议,谢谢!
在 MATLAB 中,对于上三角矩阵A,您可以编写
A
>> B = A' + triu(A,1)
在哪里triu(A,1)提取没有对角线的上三角形部分 - 你不希望它加倍。
triu(A,1)