Neighbourhood matrix

Straightforward function is the nb2mat() function (not in the book).

It converts the ‘sparse’ neighbours list to a square neighbourhood matrix of weights.