Skip to content

Commit de1444c

Browse files
authored
document getindex() with range of length 1. (#41140)
Added an example with A[:, 3:3] which returns a Matrix instead of a Vector. Somebody made me aware of this behavior on [stackoverflow](https://stackoverflow.com/questions/67889148/let-indexing-return-a-matrix-instead-of-a-vector-in-julia). but I couldn't find an example of it in the documentation.
1 parent 5b40680 commit de1444c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/src/manual/arrays.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ julia> A[:, 3]
695695
13
696696
15
697697
17
698+
699+
julia> A[:, 3:3]
700+
3×1 Matrix{Int64}:
701+
13
702+
15
703+
17
698704
```
699705

700706
### Cartesian indices

0 commit comments

Comments
 (0)