diff options
author | Nishanth Amuluru | 2010-10-11 22:44:21 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2010-10-11 22:44:21 +0530 |
commit | 0bdc27f2da8baa5bf9b8ae34df1ae5a66e856b03 (patch) | |
tree | 23e39471c705058c10961ff465517a664abbef43 /accessing-pieces-arrays/quickref.tex | |
parent | c777a70b51353182bcfadaaff9deb2b9d09cf9a2 (diff) | |
parent | 81a76e18a1b11c9565ee198d7ae58bd49d9b3acb (diff) | |
download | st-scripts-0bdc27f2da8baa5bf9b8ae34df1ae5a66e856b03.tar.gz st-scripts-0bdc27f2da8baa5bf9b8ae34df1ae5a66e856b03.tar.bz2 st-scripts-0bdc27f2da8baa5bf9b8ae34df1ae5a66e856b03.zip |
merged
Diffstat (limited to 'accessing-pieces-arrays/quickref.tex')
-rw-r--r-- | accessing-pieces-arrays/quickref.tex | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/accessing-pieces-arrays/quickref.tex b/accessing-pieces-arrays/quickref.tex index b26d168..6226b91 100644 --- a/accessing-pieces-arrays/quickref.tex +++ b/accessing-pieces-arrays/quickref.tex @@ -1,8 +1,12 @@ -Creating a linear array:\\ -{\ex \lstinline| x = linspace(0, 2*pi, 50)|} +\textbf{Accessing parts of arrays} -Plotting two variables:\\ -{\ex \lstinline| plot(x, sin(x))|} +\lstinline|C[i-1, j-1]| to access element i, j in C (mxn). +\lstinline|C[i-1]| to access i^{th} row +\lstinline|C[:, j-1]| to access j^{th} column -Plotting two lists of equal length x, y:\\ -{\ex \lstinline| plot(x, y)|} +Assigning to accessed elements, changes them. + +\lstinline|A[m:n:o]| accesses the rows from \lstinline|m| +to \lstinline|n| (excluded) in steps of \lstinline|o| + +Similarly, \lstinline|C[m:n:o, p:q:r]| |