# Linear Algebra tricks?

**URL:** <https://discourse.julialang.org/t/linear-algebra-tricks/38618>\
**Category:** General Usage\
**Created:** [May 2, 2020, 5:15pm UTC](https://discourse.julialang.org/t/linear-algebra-tricks/38618 "2020-05-02T17:15:05Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [May 2, 2020, 6:25pm UTC](https://discourse.julialang.org/t/linear-algebra-tricks/38618/9 "2020-05-02T18:25:41Z")

</div>

> [@BLI](#):
>
> Yes, but there are cases when one needs to specify the size.

There is an `I(n)` constructor, eg

```julia
julia> I(3)
3×3 Diagonal{Bool,Array{Bool,1}}:
 1 ⋅ ⋅
 ⋅ 1 ⋅
 ⋅ ⋅ 1

```

And then there is

> **[GitHub - JuliaArrays/FillArrays.jl: Julia package for lazily representing...](https://github.com/JuliaArrays/FillArrays.jl)**
>
> Julia package for lazily representing matrices filled with a single entry - GitHub - JuliaArrays/FillArrays.jl: Julia package for lazily representing matrices filled with a single entry

You are looking for `FillArrays.Eye`.

---

_[View the full topic](https://discourse.julialang.org/t/linear-algebra-tricks/38618)._
