diag_matlab function

Function written to match MATLAB's diag function