# Julia indexing question

**URL:** https://discourse.julialang.org/t/julia-indexing-question/70911
**Category:** General Usage
**Tags:** question
**Created:** [November 3, 2021, 8:47pm UTC](https://discourse.julialang.org/t/julia-indexing-question/70911 "2021-11-03T20:47:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [November 3, 2021, 8:47pm UTC](https://discourse.julialang.org/t/julia-indexing-question/70911/1 "2021-11-03T20:47:30Z")

</div>

I have a matrix as below:  
`A = [1 2 3; 4 5 6];`

I need to find the index of those that meet these requirements

```julia
Ind = map(A) do a
    (a > 4) || (a <3);
end

```

Here are the results:  
2×3 Matrix{Bool}:  
1 1 0  
0 1 1

Everything has been working so far. My goal is to replace all those elements with a new number 88. Why didn’t the below script work?  
A[Ind] .= 88;

I’m supposed to get a new matrix like this:

```julia
88 88 3
4 88 88

```

But the results Julia gives me is as below:  
88  
88  
88  
88

How should I archive my goal in this case? Many thanks!

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [November 3, 2021, 8:54pm UTC](https://discourse.julialang.org/t/julia-indexing-question/70911/2 "2021-11-03T20:54:54Z")

</div>

It is working as you intended:

```julia
julia> A[Ind] .= 88
4-element view(::Vector{Int64}, [1, 3, 4, 6]) with eltype Int64:
 88
 88
 88
 88

julia> A
2×3 Matrix{Int64}:
 88 88 3
  4 88 88

```

Note that what Julia returns from an assignment expression isn’t always going to be the value on the LHS, but that doesn’t mean the assignment didn’t occur!
