Skip to content

Commit

Permalink
Update 02-arrays.md added info that Matlab starts indexes on 1, and a…
Browse files Browse the repository at this point in the history
… labelled image.
  • Loading branch information
quirksahern authored Nov 14, 2024
1 parent 72aecd4 commit b11413f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions episodes/02-arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ its [index](../learners/reference.md#index) in parentheses:
ans = 38
```

Indices are provided as (row, column). So the index `(5, 6)` selects the element
on the fifth row and sixth column.
Indices are provided as (row, column). In Matlab, indexing starts at 1.
So the index `(5, 6)` selects the element on the fifth row and sixth column.

![](fig/Matlab_Array_Indexes.svg){alt='8-by-8 matrix with rows for each label and column indicating their number. Rows numbered 1 to 8, as are columns'}

Check warning on line 65 in episodes/02-arrays.md

View workflow job for this annotation

GitHub Actions / Build markdown source files if valid

[missing file]: [](fig/Matlab_Array_Indexes.svg)

An index like `(5, 6)` selects a single element of
an array, but we can also access sections of the matrix, or [slices](../learners/reference.md#slice).
Expand Down

0 comments on commit b11413f

Please sign in to comment.