add code to produce graph matrices in matlab format