# Update bands of a CSC Matrix

**URL:** <https://discourse.julialang.org/t/update-bands-of-a-csc-matrix/36800>\
**Category:** General Usage\
**Tags:** sparse\
**Created:** [March 31, 2020, 3:25pm UTC](https://discourse.julialang.org/t/update-bands-of-a-csc-matrix/36800 "2020-03-31T15:25:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [March 31, 2020, 3:25pm UTC](https://discourse.julialang.org/t/update-bands-of-a-csc-matrix/36800/1 "2020-03-31T15:25:26Z")

</div>

Hi,

I would like to update inplace a CSC sparse Matrix `A` which has several bands like

```julia
A = spdiagm( 0 => ones(10), 1=> ones(10-1))

```

What I would like to do is to change the values of the band `1` (for example) by modifying `A.nzval`. The only solution I can see for this is using a composite type to save the indices of the bands which correspond to the encoding used for `A.nzval`.

Before I embark into coding this, I was wondering if anybody has done ever done, or has a better solution.

Thank you for your help,
