Matlab-将散点数据点调整为质心0,0

时间:2018-07-02 19:35:47

标签: matlab

如何移动/调整所有散点数据点,以使质心为0,0?

脚本:

dataFile = dlmread('E:\C.txt'); % file stored in https://ufile.io/km74t
uniqueTable = unique(dataFile,'rows')
dataTable = array2table(uniqueTable,'VariableNames',{'X','Y'})

xCord=dataTable{:,1}
yCord=dataTable{:,2}
scatter(xCord,yCord)

hold on;

centroidX = mean(xCord)
centroidY = mean(yCord)
scatter(centroidX,centroidY) 

0 个答案:

没有答案