JuliaLang/julia — pull request #3164 by simonbyrne (2013-05-21 10:52:09+00:00)
Title: RFC: add function to access diagonal indices

Adds a method `diagind` that constructs a Range object giving the indices of the diagonal elements of a matrix. Also simplifies `diag` and `diagm`.

Addresses part of issue #3158 (see also discussion of #3152).