least_square_fit/quickref.tex
changeset 522 d33698326409
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/least_square_fit/quickref.tex	Wed Dec 01 16:51:35 2010 +0530
@@ -0,0 +1,15 @@
+Creating a matrix with all ones:\\
+{\ex \lstinline|    o = ones_like(l)|}
+
+Creating the A matrix:\\
+{\ex \lstinline|    A = array(l, ones_like(l)).T|}
+
+Computing least square:\\
+{\ex \lstinline|    result = lstsq(A, tsq)|}
+
+Obtaining the m and c values:\\
+{\ex \lstinline|    m, c = result[0]|}
+
+Computing the least square fit line:\\
+{\ex \lstinline|    lst_line = m * l + c|}
+