function[mat] = symmat(mat) mat = (mat + mat') /2;