1 answered Aug 31 '15 at 7:40 ciao 17.7k11 gold badge3838 silver badges109109 bronze badges As requested, posting my comment as an answer: UpperTriangularize[arg, 1] + LowerTriangularize[arg, -1]  seems to meet all the criteria, quite quick (surprisingly so to me). Post Made Community Wiki by ciao occurred Aug 31 '15 at 7:40