Interpolation of sparse pointwise and integral geographical Data over Time/neighbours.m

From Wikiversity
Jump to navigation Jump to search
function nbhd = neighbours(lattice, node)

%% Returns the list of neighbours of a given lattice point.

idx = (lattice.cells(:,1)==node)|(lattice.cells(:,2)==node)|(lattice.cells(:,3)==node);
nbhd = lattice.cells(idx,:);
nbhd = nbhd(:)';
nbhd = unique(nbhd(nbhd ~= node));

endfunction