Eye in julia 0.7

You can just use one(A) or oneunit(A) (depending on how you want to handle the dimensionful case) for the equivalent of eye(A) for square matrices.

(eye also worked for non-square matrices, but I don’t know of a non-verbose equivalent on 0.7.)

4 Likes