# Sparse is not defined

**URL:** <https://discourse.julialang.org/t/sparse-is-not-defined/87276>\
**Category:** General Usage\
**Created:** [September 14, 2022, 2:41pm UTC](https://discourse.julialang.org/t/sparse-is-not-defined/87276 "2022-09-14T14:41:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m\_shah2](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@m\_shah2](https://discourse.julialang.org/u/m_shah2)\
**Post date:** [September 14, 2022, 2:41pm UTC](https://discourse.julialang.org/t/sparse-is-not-defined/87276/1 "2022-09-14T14:41:38Z")

</div>

When I try to run W = sparse(W + W’);  
it gives the following error.

UndefVarError: sparse not defined

Stacktrace:  
[1] top-level scope  
@ In[13]:21  
[2] eval  
@ .\boot.jl:368 [inlined]  
[3] include\_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)  
@ Base .\loading.jl:1428

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 14, 2022, 2:47pm UTC](https://discourse.julialang.org/t/sparse-is-not-defined/87276/2 "2022-09-14T14:47:20Z")

</div>

Type [`using SparseArrays`](https://docs.julialang.org/en/v1/stdlib/SparseArrays/) first.
