No BSD License  

Highlights from
Euklid (Inverse) Distance Weight Matrix

Be the first to rate this file! 5 Downloads (last 30 days) File Size: 1.97 KB File ID: #13665

Euklid (Inverse) Distance Weight Matrix

by Felix Hebeler

 

15 Jan 2007 (Updated 23 Jan 2007)

Calculates a weight matrix of any size using the (inverse) euklidean distance from center cell.

| Watch this File

File Information
Description

function W = euklid_W(ws,d,n)
function W = euklid_invW(ws,d,n)
% PURPOSE: create an (inverse) euklidean distance spatial weight matrix
% (n x m 'moving-window' style matrix with distance to center cell
% weighted.)
% ------------------------------------------------------------------
% USAGE: W = euklid_W([wsy wsx],[dy dx],n)
% where: ws is a vector [wsy wsx] of the x and y size of the matrix (uneven!)
% d (optional) is a vector [dy dx] of the cellspacing in y and x direction
% (default 1)
% [n] (optional) specifies how to normalize the weight matrix.
% Options for [n] are:
% 1) 'norm' to create a normalized weight matrix (sum of all
% weights is 1
% 2) 'none' or NA for a non-normalized matrix (default)
% -------------------------------------------------------------------------
% OUTPUTS:
% [W] a matrix with weights for every cell except center.
% -------------------------------------------------------------------
% NOTES: Weights are the the euklidean distance to
% the center cell. Center cell weight is zero.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
11 Nov 2009 carlo montes

thaks Felix... this W can be used with the morans_I.m??
regards!

Please login to add a comment or rating.
Updates
22 Jan 2007

Updated to support different cellspacing in X and Y direction.

23 Jan 2007

Update m files so different cellsizes in X and Y direction are supported.

Tag Activity for this File
Tag Applied By Date/Time
euklid distance Felix Hebeler 22 Oct 2008 08:57:07
inverse distance Felix Hebeler 22 Oct 2008 08:57:07
weight matrix Felix Hebeler 22 Oct 2008 08:57:07
earth sciences Felix Hebeler 22 Oct 2008 08:57:07

Contact us at files@mathworks.com