changeset 522 | d33698326409 |
521:88a01948450d | 522:d33698326409 |
---|---|
1 \textbf{Accessing parts of arrays} |
|
2 |
|
3 \lstinline|C[i-1, j-1]| to access element i, j in C (mxn). |
|
4 \lstinline|C[i-1]| to access i^{th} row |
|
5 \lstinline|C[:, j-1]| to access j^{th} column |
|
6 |
|
7 Assigning to accessed elements, changes them. |
|
8 |
|
9 \lstinline|A[m:n:o]| accesses the rows from \lstinline|m| |
|
10 to \lstinline|n| (excluded) in steps of \lstinline|o| |
|
11 |
|
12 Similarly, \lstinline|C[m:n:o, p:q:r]| |