\documentclass[12pt]{article}
\usepackage{times}
\pagestyle{empty}

\addtolength{\textwidth}{1.2in}
\addtolength{\textheight}{1.2in}
\addtolength{\oddsidemargin}{-.58in}
\addtolength{\evensidemargin}{-.58in}
\renewcommand{\baselinestretch}{1.0}
\parindent = 0cm
\parskip = .1cm

\begin{document}

\begin{center}
\Large
{\bf \textsc{MatLab}} Commands for Linear Algebra\footnote{Copyright
\copyright2002 Todd Young. All rights reserved.  Updated
 -- \today. Please return any comments to: young@math.ohiou.edu}\\
\large (Keep as a reference)
\end{center}

\vspace{.2cm}
{\bf Making vectors:}
Unless otherwise specified, variables are row vectors (\verb$1 x n$ arrays).
Here are examples of ways to form vectors. Try them:
\begin{itemize}
\item \verb&b = [1 2 3 4]&
\item \verb&b = b'&
\item \verb&xx = 0:.1:2& 
\item \verb&yy = linspace(0,3,13)&
\end{itemize}

{\bf Making matrices:}
\begin{itemize}
\item \verb&A = [1 2 3; 4 5 6]&
\item \verb&C = eye(3)&
\item \verb&D = ones(4)&
\item \verb&E = zeros(5,3)&
\item \verb&F = rand(2,3)&
\item \verb&G = randn(5)&
\item \verb&H = hilb(5)&
\item \verb&P = pascal(4)&
\item Commands for other speciality matrices include:
      \verb&gallery&, \verb&hadamard&, \verb&hankel&,\\ \verb&invhilb&, \verb&magic&,
      \verb&rosser&,
      \verb&toeplitz&, \verb&vander&, \verb&wilkinson&.
\end{itemize}

{\bf Basic operations:}
\begin{itemize}
\item \verb&B = A'&
\item \verb&A*C&
\item \verb&C*A& \dotfill Will not work, \verb&C& is 3 by 3 and \verb&A& is 2 by 3.
\item \verb&x = P \ b& \dotfill Solves \verb$Px=b$.
\item \verb&P*x&   \dotfill Checks the previous command.
\end{itemize}

\newpage


\vspace{.5cm}
{\bf Some speciality commands}
\begin{itemize}
\item \verb&[m n] = size(A)&
\item \verb&P = pascal(5), p = diag(P)&
\item \verb&diag(p)&
\item \verb&flipud(A)&
\item \verb&fliplr(A)&
\item \verb&v = randn(10,1), a = abs(v)&
\item \verb&s = sort(v), m = max(v)&
\item \verb&norm(v)&
\item \verb&norm(eye(4))&
\item \verb&D, N = Null(D), D*N&
\item \verb&rank(D)&
\item \verb&det(D)&
\item \verb&trace(D)&
\item \verb&inv(G), N*G, G*N&
\item \verb&cond(H)&
\end{itemize}


{\bf Some matrix decompostions:}
\begin{itemize}
\item \verb&[L U P] = lu(G)&
\item \verb&[V m] = eig(G)&
\item \verb&[U T] = schur(G)&
\item \verb&[Q R] = qr(G)&
\item \verb&[U S V] = svd(G)&
\end{itemize}

\end{document}
