cloequ.m
来自「这是用于国土资源调查时」· M 代码 · 共 40 行
M
40 行
function cloequ%UNTITLED1 Summary of this function goes here% Detailed explanation goes herecode=input('In put the codes');area=input('In put the area');[c,r]=size(code);for i=1:c a(i)=code(i,1); b(i)=code(i,2);enddr=1/(2*sqrt(c/area));for i=1:c min(i)=100000000; number(i)=0; for j=1:c if i~=j D=sqrt((a(j)-a(i))^2+(b(j)-b(i))^2); if dr>D number(i)=number(i)+1; end if min(i)>D min(i)=D; end end endendsigmadist=0;sigmanumber=0;for i=1:c sigmanumber=number(i)+sigmanumber; sigmadist=sigmadist+min(i);endformat short%text('最近邻点平均距离')do=sigmadist/c%text('最近邻点指数')r=do/dravernumber=sigmanumber/c
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?