**GIS Function:**

Grid Weighting

**weight**

Calculate the weighted grid value.

**Syntax**

g = weight (value,endpoint,W)

**Description**

g = weight (value,endpoint,W) returns the matrix g after weighting.value is a grid matrix need to be weighted; endpoint is the endpoints number matrix corresponding to value; W is a N by 2 weight factor matrix. N is weight level number, the first column of W is the upper bound of weight level, the second column of W is the corresponding weight factors of this level. Say W equals [0.3 0.1;0.5 0.5;1 1], then the weight level is 3, the first level is 0~0.3 of average endpoint number with weight factor at 0.1, the second level is 0.3~0.5 of average endpoint number with weight factor at 0.5, and the final level is 0.5~1 of average endpoint number with weight factor at 1.

Grid Smoothing

**gridsmooth**

Smooth the grid value.

**Syntax**

g = gridsmooth (grid)

**Description**

g = gridsmooth (grid) returns the matrix g after smoothing of original grid matrix grid.

Peak Identification

**gridpeak**

Determine the grid peaks.

**Syntax**

[x,y,value] = gridpeak (grid,number)

**Description**

[x,y,value] = gridpeak (grid,number) returns the highest peak location [x,y] and value. grid is a grid matrix need to analysis; number is the returned peak number.