% 22dec93, updating version of 8mar93
\documentstyle[leqno,12pt]{siam}  
\pagestyle{empty}
\input{mssymb}
\hoffset=-0.5in

\def\ov{\overline}

\begin{document}

\begin{center}
{\Large\sf MATLAB: Some Useful Commands for CO350}
\end{center}
% \author{ {\em }
% \thanks{ } 
% }
% \date{}
\bigskip
\bigskip
\bigskip


\begin{tabular}{||l@{\hspace{0.1in}}ll||}
\hline
\hline
ACTION & \multicolumn{2}{l||}{MATLAB COMMAND} \\
\hline
starting	&	matlab & \\
\hline
stopping	&	exit & \\
\hline
getting help	&	help & \\
\hline
defining a matrix &
\mbox{
\begin{tabular}{ccccc}
P = [ & 1 & 2 & 3 & \\
	& 4 & 5 & 6 & ] 
\end{tabular}
} & \\
\hline
defining a vector & rw = [ 1 2 3 4 ] & \\
		& cl = [ 4 3 1 2 ] & \\
\hline
defining a submatrix & AB = A( rw, cl) & (AB is submatrix of A formed by \\
				& & rows 1,2,3,4 and cols 4,3,1,2) \\
defining a subvector & cb = c( rw ) & (cb is subvector of c formed by \\
				& &  indices 1,2,3,4) \\
\hline
changing a component & A(2,3) = 7  & (A is a matrix) \\
		& rw(2) = 5  & (rw is a vector) \\
\hline
matrix transpose &	A = P' & \\
vector transpose &	f = c' & \\
\hline
adding two matrices &	A = P $+$ Q		& (P$_{m\times n}$, Q$_{m\times n}$) \\
subtracting two matrices &	A = P $-$ Q	& (P$_{m\times n}$, Q$_{m\times n}$) \\
\hline
multiplying two matrices &	A = P * Q	& (P$_{m\times n}$, Q$_{n\times p}$) \\
multiplying a matrix & A = t * Q	& (Q$_{m\times n}$, t scalar) \\
\quad by a scalar & & \\
multiplying a vector & f = t * d	& (d$_{m\times 1}$, t scalar) \\
\quad by a scalar & & \\
\hline
solving a linear system & y = cb / AB & (solves the system y AB = cb,  where\\
		& & AB is ${m\times m}$, y, cb are row vectors) \\
solving a linear system & d = AB $\backslash$ a		& (solves the system AB d = a, where \\
		& & AB is ${m\times m}$, d, a are column vectors) \\
\hline
component-wise division & f = x ./ d		& ( x$_{1\times m}$, d$_{1\times m}$ \quad OR \quad
				x$_{m\times 1}$, d$_{m\times 1}$ ) \\
\hline
printing a matrix &	A & \\
\quad on the screen & & \\
\hline
deleting a variable &	clear  A & \\
deleting all variables &	clear  & \\
\hline
saving all variables &	\multicolumn{2}{c||}{TYPE help save AND FOLLOW INSTRUCTIONS} \\
\hline
retrieving previously &	\multicolumn{2}{c||}{TYPE help load AND FOLLOW INSTRUCTIONS} \\
\quad saved variables & & \\
\hline
getting a ``log file" for the & \multicolumn{2}{c||}{TYPE help diary AND FOLLOW INSTRUCTIONS} \\
\quad MATLAB session & & \\
\hline
displaying results with & \multicolumn{2}{c||}{TYPE format long AT START OF MATLAB SESSION} \\
\quad maximum precision & & \\
\hline
\hline
\end{tabular}
		
\end{document}
