📄 make_nnwd.m
字号:
% PURPOSE: An example of using make_nnw% a nearest neighbor spatial weight matrix% on a small data set %---------------------------------------------------% USAGE: make_nnwd%---------------------------------------------------clear all;% load Anselin (1988) Columbus neighborhood crime dataload anselin.dat; xc = anselin(:,4);yc = anselin(:,5);% To construct a row-stochastic weight matrix based on m neighbors% (where m is the # of nearest neighbors,)W2 = make_nnw(xc,yc,2); % 4 neighborsW4 = make_nnw(xc,yc,4);spyc(W2,'o');hold on;spyc(W4,'+');title('2 versus 4 nearest neighbors W-matrices');legend('2 nearest','4 nearest');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -