[n, d] = size(coordinate);
assert(d == 2);
resi = sparse(Adj * diag(1:n));
resj = sparse(diag(1:n) * Adj);
res = sparse(zeros(n));
f = find(Adj)
res(f) = sqrt((coordinate(resi(f), 1) - coordinate(resj(f), 1)) .^ 2 + (coordinate(resi(f), 2) - coordinate(resj(f), 2)) .^ 2);
EDIT: Oops, fixed a bug
Clarification: I'm assuming by coordinate matrix you mean like http://www.passagesoftware.net/webhelp/Coordinate_Matrix.htm
EDIT 2: I'm actually not sure whether Adj is a matrix of logicals (or whether you can have a sparse matrix of logicals). I fixed it to sidestep that potential pitfall