MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   squareform得到的距离平方矩阵怎么还原 (https://www.labfans.com/bbs/showthread.php?t=3386)

drosophilia 2008-06-01 11:56

squareform得到的距离平方矩阵怎么还原
 
X为N*P 矩阵
pdist(X)后,得到Y,
Y是一个行向量 数目为N*N/2
运行 Z=squareform(Y)后
Z是一个距离平方矩阵
对Z操作的话,怎么还原到Y
Y是一个行向量, 为Z的左下三角矩阵中按列排列的

(我的数据来源不是按矩阵格式,而是直接的距离矩阵数据,所以想请教这个问题,有点象找squareform的反函数)

slgu 2008-06-01 16:11

squareform(Z)

drosophilia 2008-06-03 22:46

[QUOTE=slgu;11739]squareform(Z)[/QUOTE]

:tongue: 哥们,你太很了,哈哈,谢谢了,这个还害我写了个小程序


接着问一个问题:就是
能不能把这个距离矩阵Z或 Y行向量还原到原来的数据矩阵X,就是N*P 矩阵(pist之前的原数据)

slgu 2008-06-03 23:14

不可能!无此可能性!


所有时间均为北京时间。现在的时间是 11:08

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.