Daniel@0: function D = PsdToEdm(G) Daniel@0: Daniel@0: d = diag(G); Daniel@0: D = bsxfun(@plus, d, d') - 2 * G;