Takes an array and a specified dimension and returns a matrix whose major diagonal elements are the elements of the array.