📄 xy2cont_d.m
字号:
% PURPOSE: An example of using xy2cont()% creates a contiguity matrix from% latittude-longitude coordinates %---------------------------------------------------% USAGE: xy2cont_d %---------------------------------------------------load anselin.dat; % Columbus neighborhood crimexc = anselin(:,5); % longitude coordinateyc = anselin(:,4); % latittude coordinate% create contiguity matrix from x-y coordinates[W1 W2 W3] = xy2cont(xc,yc);fprintf(1,'non-symmetric weight matrix \n');fprintf(1,'sum of 1st row elements = %8.2f \n',sum(full(W2(1,:))));fprintf(1,'sum of 1st column elements = %8.2f \n',sum(full(W2(:,1))));spyc(W2,'ok'); title('row-stochastic weight matrix');fprintf(1,'symmetric non row-stochastic weight matrix \n');fprintf(1,'sum of 1st row elements = %8.2f \n',sum(full(W1(1,:))));fprintf(1,'sum of 1st column elements = %8.2f \n',sum(full(W1(:,1))));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -