summaryrefslogtreecommitdiff
path: root/accessing-pieces-arrays
diff options
context:
space:
mode:
authorPuneeth Chaganti2010-10-11 11:40:04 +0530
committerPuneeth Chaganti2010-10-11 11:40:04 +0530
commit98aafc8888970c0dc6da22cfb057c103334065ed (patch)
treee5e1b2b8f0255a378f8202668bc182592c4dc1f4 /accessing-pieces-arrays
parentf09d82f3c8f5a84ece5a42412e31cf1c71b89ea9 (diff)
downloadst-scripts-98aafc8888970c0dc6da22cfb057c103334065ed.tar.gz
st-scripts-98aafc8888970c0dc6da22cfb057c103334065ed.tar.bz2
st-scripts-98aafc8888970c0dc6da22cfb057c103334065ed.zip
Quickrefs
Diffstat (limited to 'accessing-pieces-arrays')
-rw-r--r--accessing-pieces-arrays/quickref.tex16
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]|