我正在尝试确定从点的距离如何影响测量以找到点范围内的最小/最大点。
我试图在附件中执行此操作,但我找不到以编程方式执行此操作的方法。我试图通过连接一个 N 行的表,N 次,复制 XY 库,排序 Y 然后 X 然后将这个排序的列粘贴到 NxN 表中来做到这一点。
我尝试使用 EVAL / SUBSTITUTION 执行此操作,但无法成功执行。
你看到 Distance() 函数了吗? 这是使用它的脚本的脚本索引中的一个示例:
Names Default To Here( 1 );
/*1-D example*/
exX1 = [1, 2, 3, 4];
exX2 = [2, 4, 6, 8];
/*Compute squared Euclidean distance*/
exD = Distance( exX1, exX2 );
/*Verify result*/
exDm = J( 4, 4, . );
For( exi = 1, exi <= 4, exi++,
For( exj = 1, exj <= 4, exj++,
exDm[exi, exj] =
Sum( (exX1[exi, 0] - exX2[exj, 0]) ^ 2 )
)
);
Show( exDm == exD );
/*2-D example*/
exX1 = [1 1, 2 2, 3 3, 4 4];
exX2 = [2 1, 4 2, 6 0, 8 7];
/*Compute squared Euclidean distance*/
exD = Distance( exX1, exX2 );
/*Verify result*/
exDm = J( 4, 4, . );
For( exi = 1, exi <= 4, exi++,
For( exj = 1, exj <= 4, exj++,
exDm[exi, exj] =
Sum( (exX1[exi, 0] - exX2[exj, 0]) ^ 2 )
)
);
Show( exDm == exD );
/*2-D example*/
exX1 = [1 1, 2 2, 3 3, 4 4];
exX2 = [2 1, 4 2, 6 0, 8 7];
/*Compute squared Euclidean distance, with a scaler [0.5 2.0]*/
exD = Distance( exX1, exX2, [0.5 2.0] );
/*Verify result*/
exDm = J( 4, 4, . );
For( exi = 1, exi <= 4, exi++,
For( exj = 1, exj <= 4, exj++,
exDm[exi, exj] =
Sum(
[0.5 2.0] :*</img> (
Abs( exX1[exi, 0] - exX2[exj, 0] ) ^ 2)
)
)
);
Show( exDm == exD );
/*2-D example*/
exX1 = [1 1, 2 2, 3 3, 4 4];
exX2 = [2 1, 4 2, 6 0, 8 7];
/*Compute squared Euclidean distance, with scalers [0.5 2.0] and powers [1.5 2.0]*/
exD = Distance( exX1, exX2, [0.5 2.0], [1.5 2.0] );
/*Verify result*/
exDm = J( 4, 4, . );
For( exi = 1, exi <= 4, exi++,
For( exj = 1, exj <= 4, exj++,
exDm[exi, exj] =
Sum(
[0.5 2.0] :*</img> (
Abs( exX1[exi, 0] - exX2[exj, 0] ) :^ [
1.5 2.0])
)
)
);
Show( exDm == exD );