\documentstyle[12pt]{article}

%%%%%00macros.tex
%
\catcode`\^^Z=10 % ASCII Ctrl-Z is treated as a blank (Tex book p 343)
%
%
% \thepage is replaced by \ThePage in mmbook.sty
% \ThePage is redefined in 00book.tex after \appendix
% This assures that pages in appendices will be numbered
%  A-1 A-2, ... B-1, B-2,  .. etc.
%
% For table of contents  the macro \FixPagePrefix{X} is
% written on 00book.toc at the beginning of each appendix.
% When read by \tableofcontents command
% this enables contents to agree with page numbering A-1 etc.
%
%
%
% \input{bbb12} % remark: use bbb10 with 10pt style
\newcommand{\Bbb}{\bf}
\newcommand{\ds}{\displaystyle}
%
%\def\boxit#1{\vbox{\hrule\hbox{\vrule\kern3pt
%            \vbox{\kern3pt#1\kern3pt}\vrule}\hrule}}
%
\newcommand{\dotm}{{\tt .M}\hspace{1ex}}
\newcommand{\TorF}{{\bf [T] [F]}} % true or false?
%
\newcommand{\N}{{\Bbb N}}
\newcommand{\Q}{{\Bbb Q}}
\newcommand{\Z}{{\Bbb Z}}
\newcommand{\R}{{\Bbb R}}
\newcommand{\C}{{\Bbb C}}
\newcommand{\F}{{\Bbb F}}
%
\newcommand{\MAT}[1]{\left[\begin{array}{#1}}
\newcommand{\RIX}{\end{array}\right]}
%
\newcommand{\xy}{\xi} % indeterminate
\newcommand{\inner}[2]{\left\langle #1, #2 \right\rangle}
\newcommand{\GRP}{{\cal G}}        % Matrix Group
\newcommand{\HRP}{{\cal H}}        % Another Matrix Group
\newcommand{\GEN}{{\cal E}}        % Generators of matrix group
\newcommand{\VSP}{{\cal V}}        % Matrix Subspace
\newcommand{\WSP}{{\cal W}}        % Matrix Subspace
\newcommand{\USP}{{\cal U}}        % Matrix Subspace
\newcommand{\nullsp}{{\cal N}}     % Null space
\newcommand{\colsp}{{\cal R}}      % Column space
\newcommand{\eigsp}{{\cal E}}      % Column space
\newcommand{\BMX}{\Phi}            % Basis for \VSP.
\newcommand{\AMX}{\Psi}            % Another such
\newcommand{\CMX}{\Upsilon}        % Another such
\newcommand{\bmx}{\nu}             % number of columns in \BMX
\newcommand{\amx}{\mu}             % number of columns in \AMX
\newcommand{\TRX}{T}               % Transition matrix \AMX=\BMX\TRX
%
\newcommand{\DDT}[1]{ \frac{d^{#1}\phantom{t}}{dt^{#1}}}
\newcommand{\ddt}{d/dt} 
%
%
% Linear maps and vector spaces
%
%\newcommand{\SMX}{\Phi}            % Basis Matrix for \nullsp(A)
%\newcommand{\bBMX}{{\bf \Phi}}         % corresponding frame to \BMX
%\newcommand{\bAMX}{{\bf \Psi}}         % corresponding frame to \AMX
%\newcommand{\bCMX}{{\bf \Upsilon}}     % corresponding frame to \CMX
% \newcommand{\II}{{\bf I}}
% \newcommand{\LL}{{\bf L}}
% \newcommand{\NN}{{\bf N}}
% \newcommand{\UU}{{\bf U}}
% \newcommand{\VV}{{\bf V}}
% \newcommand{\WW}{{\bf W}}
% \newcommand{\TT}{{\bf T}}
% \newcommand{\SS}{{\bf S}}
% \newcommand{\uu}{{\bf u}}
% \newcommand{\vv}{{\bf v}}
% \newcommand{\ww}{{\bf w}}
% \newcommand{\0}{{\bf 0}}
% \newcommand{\biota}{{\bf \iota}} % inclusion
% \newcommand{\bpi}{{\bf \pi}}     % projection
% \newcommand{\bPi}{{\bf \Pi}}     % idempotent
% \newcommand{\bPhi}{{\bf\Phi}}    % frame
% \newcommand{\bphi}{{\bf\phi}}    % element of corresponding basis
% \newcommand{\bPsi}{{\bf\Psi}}    % frame
% \newcommand{\bpsi}{{\bf\psi}}    % element "         "       "
% \newcommand{\bUpsilon}{{\bf Upsilon}}  % frame (used only in one place)
%
%  Matrix maps
%
% \newcommand{\Aa}{{\bf A}}
% \newcommand{\Bb}{{\bf B}}
% \newcommand{\Cc}{{\bf C}}
% \newcommand{\Dd}{{\bf D}}
% \newcommand{\Ii}{{\bf I}}
\newcommand{\Jj}{{\bf J}}
% \newcommand{\Ll}{{\bf L}}
% \newcommand{\Nn}{{\bf N}}
% \newcommand{\Pp}{{\bf P}}
% \newcommand{\Qq}{{\bf Q}}
% \newcommand{\Rr}{{\bf R}}
% \newcommand{\Ss}{{\bf S}}
% \newcommand{\Tt}{{\bf T}}
%
%
\newcommand{\jdef}[1]{{\bf #1}\index{#1}}
\newcommand{\kdef}[1]{#1\index{#1}}
%
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
%\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{function}[theorem]{Function}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}[theorem]{Example}
\newtheorem{examples}[theorem]{Examples}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{cexercise}[theorem]{Exercise} % Computer exercise
\newtheorem{question}[theorem]{Question}
%
\newcommand{\EXERCISES}{\begin{center}\bf\Large Exercises\end{center}}
%
%
\newcommand{\sep}{|}
\newcommand{\col}{\mathop{\rm col}\nolimits}
\newcommand{\row}{\mathop{\rm row}\nolimits}
\newcommand{\entry}{\mathop{\rm entry}\nolimits}
\newcommand{\diag}{\mathop{\rm diag}\nolimits}
\newcommand{\Diag}{\mathop{\rm Diag}\nolimits}
%
\newcommand{\Scale}{\mathop{\rm Scale}\nolimits}
\newcommand{\Swap}{\mathop{\rm Swap}\nolimits}
\newcommand{\Shear}{\mathop{\rm Shear}\nolimits}
%
\newcommand{\tr}{^\top}                               % transpose
\newcommand{\ctr}{^*}  % {^{\overline{\top}}}         % conjugate transpose
\newcommand{\Tilde}[1]{\widetilde{#1}}
%
\newcommand{\ONE}{(1)} %{\mbox{$(\clubsuit)$}}
\newcommand{\TWO}{(2)} %{\mbox{$(\diamondsuit)$}}
\newcommand{\THREE}{(3)} %{\mbox{$(\heartsuit)$}}
\newcommand{\FOUR}{(4)} %{\mbox{$(\spadesuit)$}}
\newcommand{\FIVE}{(5)} %{\mbox{$(\Box)$}}
\newcommand{\SIX}{(6)} %{\mbox{$(\triangle)$}}
\newcommand{\SEVEN}{(7)} %{\mbox{$(\nabla)$}}
\newcommand{\half}{{\scriptstyle\frac{1}{2}}}
\newcommand{\IMP}{\Longrightarrow}
\newcommand{\SUB}{\subset}
\newcommand{\sgn}{\mathop{\rm sgn}\nolimits}
\newcommand{\adj}{\mathop{\rm adj}\nolimits}
\newcommand{\trace}{\mathop{\rm trace}\nolimits}
\newcommand{\rank}{\mathop{\rm rank}\nolimits}
\newcommand{\nullity}{\mathop{\rm nullity}\nolimits}
\newcommand{\IC}[2]{I_{#1,#2}} % #2-th column of the identity matrix
\newcommand{\eps}{\varepsilon} % for identity permutation
%
\newcommand{\dig}{\phantom{0}} % For alignment
\newcommand{\sig}{\phantom{+}} %      "
%
%\newcommand{\LABEL}[1]{{\label{#1}\marginpar{#1}}}
\newcommand{\LABEL}[1]{\label{#1}}
%
\newcommand{\onpage}[1]{on page~\pageref{#1}}
\newcommand{\Onpage}[1]{On page~\pageref{#1}}
\newcommand{\frompage}[1]{from page~\pageref{#1}}
\newcommand{\Frompage}[1]{From page~\pageref{#1}}
\newcommand{\seepage}[1]{see page~\pageref{#1}}
\newcommand{\Seepage}[1]{See page~\pageref{#1}}
%
%
\newcommand{\key}[1]{[{\bf #1}]}
%
%
\newcommand{\proof}[1]{
\def\xaxa{#1}
\ifx\xaxa\empty
\noindent {\bf Proof:}
\else
\noindent {\bf Proof of \xaxa:}
\fi
}
\newcommand{\QEDSYM}{{\bf [QED]}}
\newcommand{\QED}[1]{\hfill
\def\xbxb{#1}
\ifx\xbxb\empty
{ \QEDSYM}
\else
{ \QEDSYM \xbxb]}
\fi \medskip
}
%
\newcommand{\EXAMPLE}{\par\medskip\par\noindent{\bf Example:\hspace{1em}}}
%
\newcommand{\program}[1]{\center{#1}}
\newcommand{\CAPTION}[1]{\center{#1}}
%
%\newenvironment{computer}{\small}{}
%
\newcommand{\BoldHeadline}[1]{\begin{center}
{\bf #1}
\end{center} \par
}
%
%\newenvironment{warning}{\samepage\WARNING\begin{quote}}{\end{quote}}
%
\newenvironment{arrowgram}[2]{
\begin{center}\setlength{\unitlength}{1.2em}\begin{picture}(#1,#2)}{
\end{picture}\end{center}}
%
\newenvironment{mmtable}{\begin{center}\begin{tabular}{|lll|}\hline\hline
\renewcommand{\arraystretch}{1.2}
MINIMAT  & Mathematics  &English\\ \hline\phantom{.}&&\\
}{\phantom{.}&&\\ \hline\hline\end{tabular}\end{center}}
%
\newenvironment{lawtable}{
\begin{center}\begin{tabular}{|ll|}\hline & \\*[0.01\textwidth]
}{ & \\*[0.01\textwidth]\hline\end{tabular}\end{center}}
%
\newenvironment{mmbox}{\begin{center}\begin{tabular}{||lp{0.9\textwidth}l||}\hline\hline&&\\&\it
                     }{&\\&&\\ \hline\hline\end{tabular}\end{center}}
%
%
\newenvironment{thmbox}{\bigskip \begin{center}\begin{tabular}{||lp{0.9\textwidth}l||}\hline\hline&&\\&
                   \vspace*{-1.05em}  }{ \vspace*{-1.05em}&\\&&\\ \hline\hline\end{tabular}\end{center}\bigskip}
%
\newenvironment{mmfloat}{\begin{table}[t]\centering
                     }{\end{table}}
%  
%
\newenvironment{mmfloatbox}{\begin{mmfloat}\begin{mmbox}
                     }{\end{mmbox}\end{mmfloat}}
%  
%
\newenvironment{mmpage}{\begin{table}[p]\centering
                     }{\end{table}}
%  
\newenvironment{mmpagebox}{\begin{table}[p]\centering\begin{mmbox}
                     }{\end{mmbox}\end{table}}
%
%  
%
\newenvironment{mmfigure}{\begin{figure}\begin{mmbox}\centering
                     }{\end{mmbox}\end{figure}}
%  
%
\newenvironment{mmcenterbox}{\begin{center}\begin{mmbox}
                     }{\end{mmbox}\end{center}}
% 
\newcommand{\summary}{\begin{center}\LARGE\bf  Chapter Summary \end{center}} 
%
%%%%%\newcommand{\USING}[1]{\input{#1}}
%
%%%%%\newcommand{\SECTION}[1]{\section{ Using MINIMAT}}% (discard argument)
%
%%%%%%%%%%%%%%%%%% ANSWERS %%%%%%%%%%%%%%%%%
%
%  \Amark\ (or \amark\) and \answer occur together.
%
\newcommand{\MAR}[1]{\makebox[0in][r]{\bf #1:\quad}}
\newcommand{\ANSYM}{(@)}        % in case we change \Amark
\newcommand{\Amark}{\rm \ANSYM} % for questions, problems etc.
\newcommand{\amark}{\ANSYM}     % for propositions
%
\outer\def\answer{\par\medbreak
  \immediate\write\ans{}
  \immediate\write\ans{\string\medskip}
  \immediate\write\ans{}
  \immediate\write\ans{\string\noindent\string\MAR\string{\thetheorem\string}}
  \copytoblankline}
%
\def\copytoblankline{\begingroup\setupcopy\copyans}
%
\def\setupcopy{\def\do##1{\catcode`##1=12}\dospecials
     \catcode`\|=12\obeylines}
%
{\obeylines \gdef\copyans#1
  {\def\next{#1}%
  \ifx\next\empty\let\next=\endgroup%
  \else\immediate\write\ans{\next}\let\next=\copyans\fi\next}}
%
%
%
%%%%%%%%%%%%%     \BLAH   %%%%%%%%%%%%%%%%%%%%%%%
%
\newcommand{\BLAH}{BLAH\message{BLAH}}


\begin{document}
%%%%%%%%%%%%%%%% 6labtut

\begin{center}
     MINIMAT TUTORIAL\\
     Joel Robbin\\
     June 92
\end{center}

    The purpose of this tutorial is to give you a feeling for how
MINIMAT interacts with the user and what it can do. The tutorial
is not intended to be a definitive account\footnote{You can find a
complete account of MINIMAT in the {\it MINIMAT Reference Manual},
but most users will find that information in this text together
with the online information accessible
through MINIMAT's {\it help facility} (explained below) is
more than adequate for their needs.} of anything:
MINIMAT's commands are explained more carefully in the  sequel. 
To use this tutorial simply type the indicated
commands at MINIMAT and compare the output with the text.

{\samepage
     That portion of the text in this chapter
which is actually produced by the computer is
set in typewriter type
 \begin{verbatim}
           Like this. \end{verbatim}
All text typed into the computer
by the user appears in typewriter type on a line
beginning with the MINIMAT's prompt as in
\begin{verbatim}
   #>  A = [1 2; 3 4]\end{verbatim}
All other text in typewriter
type represents output produced by MINIMAT as in
\begin{verbatim}
    A = [ 1.000   2.000
          3.000   4.000 ]\end{verbatim}
}

\section{ Before You Begin}

\vspace{-1em}


     Before you use MINIMAT you should make a backup
copy using the \verb$copy$ command from the Operating System.
If you are completely new to computers you will have to
learn a few things first, like
  (1) how to turn the computer on and off;
  (2) how to boot the operating system;
  (3) how to change the default disk/directory;
  (4) how to execute a program from the operating system;
  (5) how to copy files from one disk to another.
These details will be peculiar to the particular computer system
you are using and will not be explained here.


The easiest way to use MINIMAT is to put all the files
on the distribution diskette in one directory (if you have
a hard disk) or diskette (if you do not) and to make that
disk/directory the default. We shall assume you have done this.



\section{ Starting Up}

\vspace{-1em}

     We begin the session by typing
 \verb$minimat$ (followed by \key{Enter})
at the DOS prompt; this causes DOS to start the MINIMAT program.
First MINIMAT displays a sign-on message. Pressing any key will
cause MINIMAT to continue; MINIMAT will continue in any case
after three seconds.

 MINIMAT finds the file \verb$mmlogin.m$\footnote{If MINIMAT
does not find this file it will simply print the prompt.}
on the default directory and executes\footnote{If you press
a key while MINIMAT is executing a command, MINIMAT asks
you if you want to interrupt the calculation. If you respond
affirmatively, then MINIMAT prints the prompt.}
the commands in that file.  
% Those commands cause MINIMAT to print the following message.

\vspace{-1em}

{\samepage
\begin{verbatim}
At the  #> prompt, the following may be entered:

 help                (to view the file minimat.hlp)
 type filename.ext   (to view the file filename.ext)
 edit filename.ext   (to edit the file filename.ext)
 mmdemo              (a demonstration)
 Press a key: \end{verbatim}
}
We press a key and MINIMAT continues by clearing the screen
and printing the prompt.


\section{ The Prompt}\index{prompt}
When MINIMAT is waiting for input it issues a prompt:
 \begin{verbatim}
    #> \end{verbatim}
If at some point in the session MINIMAT has not issued the prompt
when you think it should,
it may be that you have not completed typing the last line (perhaps
there is an open parenthesis). In this case (if you do
not know how to complete the statement correctly)
you may press \key{Esc} (the escape key) to recover the prompt.
If you press \key{Enter} before you have typed a complete statement,
the message line at the top of the screen shows
what symbol is needed to complete that statement.



\section{ Sample Session}
 We evaluate some simple MINIMAT expressions and assign them to
variables. Note how the variable \verb$ans$ contains the result
of the last  expression  evaluated which was not explicitly
assigned to some variable.
\begin{verbatim}
   #> 3*4-1

      ans = 11.000

   #> t=rand(1,1), x=cos(t), y=sin(t), x^2+y^2

      t   =   0.557
      x   =   0.849
      y   =   0.528
      ans =   1.000\end{verbatim}
Note that MINIMAT's notations are similar to those
used in mathematics and most programming languages
like BASIC. It uses the asterisk \verb$*$ to denote
multiplication\index{multiplication}
(if we write $AB$ when we mean $A*B$, then
MINIMAT will think of $AB$ as a symbol by itself
having nothing to do with either $A$ or $B$).
Note also that several statements may appear the
same line if they are separated by commas.

At this point we ask for help.
 {\samepage
 \begin{verbatim}
   #> help

**********     MINIMAT HELP FILE.  **************
  Here are some MINIMAT statements:

   a=[1 2 3; 4 5 6; 7 8 9]
   b=ref(a)
   x=[1 -2 1]'
   a*x,   b*x
   [m n] = size(a)
   b=a'+a
   c=a*b/2
   c=a+2*c

**********************************************
*  Press the  PgDn  key  to see more.        *
*  Type Alt-x to return to MINIMAT           *
********************************************** \end{verbatim}
}
(We show only one screenful of the \verb$help$ facility here.)
We type \key{Alt-X} to return to MINIMAT.

At this point we use MINIMAT's convenient notations to
perform Gaussian elimination.
First we enter a simple matrix:
\begin{verbatim}
   #> A = [  1 2 3; 4 5 6; 7 8 9  ]

       A = [ 1.000   2.000   3.000
             4.000   5.000   6.000
             7.000   8.000   9.000  ]\end{verbatim}
Next we subtract an appropriate multiple of the first row
from the second to obtain a zero in the $(2,1)$-position:
\begin{verbatim}
   #> A(2,:) = A(2,:)-A(2,1)*A(1,:)

       A =  [ 1.000   2.000   3.000
              0.000  -3.000  -6.000
              7.000   8.000   9.000 ]\end{verbatim}
We do the same for the third row to produce a zero in the $(3,1)$-position:
\begin{verbatim}
   #> A(3,:) = A(3,:)-A(3,1)*A(1,:)

       A =  [ 1.000   2.000   3.000
              0.000  -3.000  -6.000
              0.000  -6.000 -12.000  ]\end{verbatim}
We scale the second row to produce a one in the $(2,2)$-position:
\begin{verbatim}
   #> A(2,:) = A(2,:)/A(2,2)

      A =  [ 1.000   2.000   3.000
             0.000   1.000   2.000
             0.000  -6.000 -12.000  ]\end{verbatim}
We subtract a multiple of the second row from the third to produce
a zero in the $(3,2)$-position.
\begin{verbatim}
   #> A(3,:) = A(3,:)-A(3,2)*A(2,:)

      A =  [ 1.000   2.000   3.000
             0.000   1.000   2.000
             0.000   0.000   0.000  ]\end{verbatim}
Finally we produce a zero in the $(1,2)$-position.
\begin{verbatim}
   #> A(1,:) = A(1,:)-A(1,2)*A(2,:)

      A = [ 1.000   0.000  -1.000
            0.000   1.000   2.000
            0.000   0.000   0.000  ]\end{verbatim}


We use MINIMAT's \verb$what$ command to find out which \dotm\
 MINIMAT can find.\index{what command}
\begin{verbatim}
   #> what

   Directory of C:\MM\*.M
     mmdemo.m     mmlogin.m     intinv.m    randsutr.m
     rref.m       solve.m       rrefmul.m   randsoln.m
     signum.m     next.m        adj.m       compan.m
     sourfram.m   bed.m         rbasis.m    nbasis.m\end{verbatim}
 We decide to find out what the \dotm\ file \verb$rrefmul.m$ does.
\index{type command}\index{rrefmul.m}
{\samepage
\begin{verbatim}
   #> type rrefm

   function [R M] = rrefmul(A)
   %
   %   R = reduced row echelon form of A
   %   M = invertible matrix which transforms A to R:
   %
   %               M*A = R
   %
   [m,n] = size(A);
   A = [A eye(m)];
   A = rref(A);
   R = A(:,1:n);
   M = A(:,n+1:n+m);\end{verbatim}
}
The \verb$type$  command listed the file \verb$rrefmul.m$ on the screen.
 The comments at the beginning of the
listing indicate that the  function \verb$rrefmul$ accepts a
matrix \verb$A$ as input and produces two matrices \verb$R$
and \verb$M$  as output: \verb$R$ is the reduced row echelon
form of \verb$A$ and \verb$M$ is the matrix which pre-multiplies
\verb$A$ to put \verb$A$ into reduced row echelon form.


We try it out.  We press \key{Alt-X} to
exit the \verb$type$ facility (just as we exited the \verb$help$ facility).
Then we enter the same matrix we entered before.


\begin{verbatim}
   #> A=[1 2 3; 4 5 6; 7 8 9]

      A = [ 1.000      2.000      3.000
            4.000      5.000      6.000
            7.000      8.000      9.000  ]\end{verbatim}
Next we invoke the \dotm\ function using the form suggested
by the heading (the first line of the file, following the keyword
\verb$function$):

\begin{verbatim}
   #> [R M]=rrefmul(A)

      R = [ 1.000   0.000  -1.000
            0.000   1.000   2.000
            0.000   0.000   0.000 ]

      M = [  0.000  -2.667   1.667
             0.000   2.333  -1.333
             1.000  -2.000   1.000  ]\end{verbatim}
We  used the same letters
-- \verb$R$, \verb$M$, \verb$A$ --
in calling \verb$rrefmul$ that are used in the text of the file
\verb$rrefmul.m$, but this is not necessary. Notice that
the value for $R$ is the same as the value for $A$ we obtained before.
We check the claim made in the listing of \verb$rrefmul.m$ above:

\begin{verbatim}
   #> M*A

     ans =[ 1.000   0.000  -1.000
            0.000   1.000   2.000
           -0.000   0.000   0.000  ]\end{verbatim}
It works! (\verb$M*A=R$.)


At this point we could terminate MINIMAT and return to DOS by typing
\begin{verbatim}
   #> quit\end{verbatim}
Don't do this yet, however. The next few sections show how
to use various aspects of MINIMAT's user interface, and you might as
well try them out now.

\section{ Function Keys and Menus}
If you  press the function key \key{F1} at the MINIMAT prompt,
 you will  will bring up the \jdef{Help menu}. If you press the
function key \key{F10} you will get the \jdef{Main menu}.
(This is indicated on the menu line at the bottom of the screen,
so you don't have to remember which key to press.) You select
menu items by either using the up/down arrow keys to highlight
the item you want and then selecting that item by pressing the \key{Enter}
(Return) key or else by typing the letter enclosed in the brackets.


\begin{mmfloat}
\renewcommand{\arraystretch}{1.2}
\setlength{\tabcolsep}{5pt}
\begin{tabular}{||l|l||l|l||}
\hline\hline
  Command         & Key Stroke &    Command         & Key Stroke  \\ \hline
  \phantom{.}     &      &&            \\
  Page up         & \key{PgUp}      &  Page down       & \key{PgDn}  \\
  Cursor left     & \key{$\leftarrow$} &  Cursor right & \key{$\rightarrow$} \\
  Cursor up       & \key{$\uparrow$}&  Cursor down     & \key{$\downarrow$} \\
  Start of line   & \key{Home}      &  End of line     & \key{End} \\
  Top of file     & \key{Ctrl-Home} &  End of file     & \key{Ctrl-End}  \\
  New line        & \key{Enter}     &  To end \& new line & \key{Shift-Enter}\\
  Scroll up       & \key{Ctrl-PgUp} &  Scroll down     & \key{Ctrl-PgDn} \\
  Scroll right    & \key{Ctrl-$\leftarrow$}& Scroll left & \key{Ctrl-$\rightarrow$} \\
  Delete under    & \key{Del}  &  Delete before    & \key{Backspace}\\
  Delete line     & \key{Ctrl-Y}& Cancel  statement & \key{Esc}\\
  Help  menu      & \key{F1} &  Local help           & \key{F2} \\
  Recall          & \key{F3} &  Main menu            & \key{F10}\\
  \phantom{.}     &      &&            \\
\hline
\multicolumn{4}{||c||}{}\\
\multicolumn{4}{||c||}
{(The local help key \key{F2} usually displays this table)}\\
\multicolumn{4}{||c||}{}\\
\hline\hline
\end{tabular}

\vspace{1em}

\CAPTION{ MINIMAT's Function Keys}
\vspace{1em}

\end{mmfloat}


The Menu facility works by passing an appropriate text line
to MINIMAT's command processor (this line will then appear on the
screen) so you don't need to use the Menu system if you can remember
the commands and like to type.


\section{ Snow and Color}
     If MINIMAT creates ``snow'' on your monitor
 when it writes to the screen, execute the
\jdef{snow} command from the \jdef{change defaults} option
\index{defaults}
on the main menu (\key{F10}). This will eliminate
the snow but slow down  the screen response.
If you are using a monochrome monitor and
the screen is hard to read, try changing colors
using the \jdef{colors} command from the defaults
menu. In either case MINIMAT will print the command
line which causes the change. You can put
a copy of this line(s) in your \verb$mmlogin.m$ file.
If you cannot see the menus or the menu bar on your monitor type
\begin{verbatim}
   #> colors bland\end{verbatim}
to change the colors to black and white. (After this command,
the menu bar and menus should be visible on {\em any} monitor.)



\section{ Transcript}

  MINIMAT remembers everything it prints to the screen.
In effect, it keeps a \jdef{transcript} of what has
transpired.
You can recall what has scrolled off the screen
by using the cursor keys  on the numeric keypad.
Using the cursor keys by themselves
will move the cursor around the screen. Pressing the control
key \key{Ctrl} and a cursor key simultaneously will
scroll the screen or move to the begining or end of your transcript.
The \verb$saveas$ command described below can be used to write
the transcript to a file on the disk for subsequent viewing,
editing, or printing.\footnote{If you know that you will want to save
the transcript, it is best to use the \verb$diary$ command (described
below) rather than the \verb$saveas$ command. The \verb$diary$ command
saves the output as it is being produced so that it will not be lost
in the event  something goes wrong with the computer.}

 \begin{thmbox} \BoldHeadline{WARNING}
If MINIMAT runs out of memory, it may be forced to discard some of the
transcript.  It does this from the front so that the output created
first is discarded first.
 \end{thmbox}


If you type input when the cursor is before the prompt,
the cursor will immediately move to the prompt. This
makes it impossible for you to alter the transcript from
MINIMAT\footnote{Of course, you can always edit any diary file
which MINIMAT may have produced.} except by adding new text at
the end.

\section{ Recall}
    If you press the \jdef{recall key} \key{F3} at the prompt,
the last statement you entered will be copied to the prompt where
you can edit it and re-execute it if you like.
Use the \key{End} key to move the cursor
to the end of the line or the \key{Ctrl-End} key to move it to the
end of the text (these will  be the same if the cursor is on the last
line of the text) before pressing \key{Enter}.

If the cursor is before the active prompt, the recall key \key{F3}
behaves differently depending on what kind of text the cursor is at.
The message line at the top of the screen indicates
what  the recall key will do at the current cursor position.
Try it out with the following:
\begin{enumerate}
  \item Enter a statement like \verb$ A=rsnd(3,4)$ with a
    typing error in it. Press \key{F3} and correct it
    to \verb$ A=rand(3,4)$,
  \item Move the cursor to the line containing the error message
        produced by your erroneous statement and press \key{F3}.
  \item Move the cursor to a line containing an earlier statement you typed
        and press \key{F3}.
  \item Move the cursor to  a matrix which MINIMAT has printed and
         press \key{F3}.
\end{enumerate}
In each case observe how the message line at the top of the screen
indicates what will happen when you press \key{F3}.


\section{ Diary}\index{diary}
MINIMAT provides the capability of keeping a record of all or
part a session on the disk.  If you type
 \begin{verbatim}
   #> diary  a:\homework.1
 \end{verbatim}
MINIMAT will create a file called \verb$homework.1$ in the root
directory on drive \verb$a:$ (this is the floppy disk drive)
and echo all subsequent screen output to this file. You
can substitute any filename you like for
\verb$a:\homework.1$. If the drive specification \verb$a:$
or the path specification (this is \verb$ \ $ in the example)
is absent then the default is assumed so that the command
 \begin{verbatim}
   #> diary  homework.1
 \end{verbatim}
will create the file \verb$homework.1$ in the default directory
on the default disk (which is probably \verb$c:$ if your computer
has a hard drive.) Finally if the file specification is missing
altogether, as in
 \begin{verbatim}
   #> diary
 \end{verbatim}
MINIMAT with create a file named \verb$diary.$ in the default
directory of the default disk. If a file matching the file specification
already exists, MINIMAT will ask you whether you want to Overwrite
the existing file, Append to it, or Cancel the \verb$diary$ command
altogether.
\footnote{
WARNING: Other versions of Matlab may not do this.
}

To stop echoing to the diary file you simply type
 \begin{verbatim}
      #> diary off
 \end{verbatim}
at the prompt. This closes the diary file. The diary file will also
be automatically closed when you quit MINIMAT.

\section{ SaveAs}\index{saveas}
    If you want to save the entire transcript the command
 \begin{verbatim}
   #> saveas  myfile
 \end{verbatim}
will  save it in a disk file \verb$myfile$.  This is useful
if you forgot to open a diary file. If appropriate,
MINIMAT gives you the Overwrite, Append, Cancel option
as for the diary file.

     The \verb$saveas$ command operates independently
of the \verb$diary$ command. Thus it is possible to create
two (or more) copies of the transcript. The difference
between the two commands is that the \verb$diary$ command
saves the transcript as it is produced, while the \verb$saveas$
command saves it all at once. Remember that if you have produced
a very long transcript, MINIMAT may have forgotten the earliest
portion of it.

\section{ Viewing the Diary}
If you want to look at the diary file from MINIMAT you
can {\em type} it like any other text file. For example,
the command
 \begin{verbatim}
    #> type a:\homework.1
 \end{verbatim}
will display that file on the screen. You can even
type a diary file that is currently being created.

If you want to study your diary file away from the
computer you will have to print it.
If you have a printer, you can print the diary file using
a suitable print program like the DOS \verb$copy$ 
program.\index{printing a file}
This can be invoked from MINIMAT using a
\jdef{shell escape}.
It works as follows. You enter
a command line to MINIMAT exactly as you would enter it
in DOS, but you precede it with an exclamation point.
DOS will process the command and return control to
MINIMAT. For example, to send the file
\verb$a:\homework.1$ to the printer you type\footnote{If
nothing happens make sure the printer is turned on and is connected properly.}
 \begin{verbatim}
   #> !copy a:\homework.1 prn \end{verbatim}

\begin{thmbox}\BoldHeadline{WARNING}
Never execute a ``Terminate but Stay Resident'' program
(that is, one which continues to work after other
programs have been invoked) as a shell escape.
The DOS \verb$PRINT$  program is such a program
(since after it starts printing but before it is finished
you can invoke other programs).
The MINIMAT shell escape \verb$!print filename$ may cause the computer
to freeze. This caveat applies to any program which invokes
other programs, not just MINIMAT.
\end{thmbox}


\section{ Comments}\index{comments}
MINIMAT will ignore any line which begins with a percent sign \verb$%$.
This allows programmers to insert  comments in \dotm\ files,
but can also be used to insert text into diary files.
For example, if you enter

 \begin{verbatim}
   #> %  This is
   #> %  a comment.
 \end{verbatim}

\noindent
MINIMAT will not respond but will copy the lines into the
 diary file if one is open.
(If the percent sign \verb$%$ were not present,
 MINIMAT would print an error message.)


\section{ Homework}\index{homework}
  The diary file and \verb$%$ comments provide a handy way
for keeping a record of your homework assignments.
You can get a blank diskette\footnote{
You will have to {\em format} the diskette before using it.
This is done by executing a
DOS (Disk Operating System) program called  \verb$FORMAT$.
}
(a double density 360K diskette ought to be
more than adequate for the entire semester)
and store all your homework assignments on it, say in files
named {\tt homework.1, homework.2,...}. You can insert
\verb$%$ comments in the diary file to keep a record of
what problem you are solving and to answer any questions
which may be part of the problem.
As an example, suppose you have been assigned the following:


\begin{cexercise} Type the following command into MINIMAT:
         \begin{verbatim}
           #> a=4,  a1=sqrt(a*a)
           #> b=-3, b1=sqrt(b*b)  \end{verbatim}
  (\verb$sqrt(c)$ is MINIMAT's name for $\sqrt{c}$.)
   Why does $a=a_1$ but $b\ne b_1$?
 \end{cexercise}


\noindent Let's solve this simple problem to illustrate the proper
format.

 \begin{enumerate}
\item
Open the diary file (MINIMAT responds):

 \begin{verbatim}
#> diary a:\hw.0

* Diary file: A:\hw.0 
* Opened at  Date/Time: 88-07-09 14:19:40
* (Type   DIARY OFF   to close the diary.)\end{verbatim}

\item
Identify yourself and the problem:
 \begin{verbatim}
#> % Sally Student.  Homework #1 due September 8.
#> % Exercise A \end{verbatim}

\item
Do the computation:
\begin{verbatim}
#> a=4, a1=sqrt(a*a)

   a  =   4.000
   a1 =   4.000

#> b=-3, b1=sqrt(b*b)

   b  =  -3.000
   b1 =   3.000\end{verbatim}

\item
Answer the question:
\begin{verbatim}

#> sqrt(9)

   ans =  3.000

#> % sqrt is the square root function. 
#> % it computes the positive square root.\end{verbatim}
\end{enumerate}

\section{ Editing and Shell Escape}
 MINIMAT has a built-in editor which you can use for
writing \dotm\ functions (\seepage{1MX})
or editing the transcript.
You can invoke it from the main menu (\key{F10})
or by typing the \verb$edit$ command as in
\begin{verbatim}
   #> edit myfunc.m\end{verbatim}
(Here \verb$myfunc.m$ can be replaced by any other legal
filename.) If the file \verb$myfunc.m$ exists it is loaded
for editing; otherwise, a new empty file by that name
is created.

  MINIMAT's built-in editor is rather primitive (though
it should be adequate for the simple tasks required
in this book). If you have another editor which you prefer
you can invoke it from MINIMAT with the \jdef{shell escape}
as in
\begin{verbatim}
   #> !qedit myfunc.m\end{verbatim}
Indeed, any command line preceeded by a \verb$!$ will be
passed to DOS and executed as if you had typed it at the
DOS prompt. This is faster than exiting MINIMAT and does
not discard any variables you have defined. 
On returning from a shell escape (or MINIMAT's edit command)
MINIMAT will
check the time stamps on any \dotm\ functions in its memory.
If it finds a non-match, it will clear all the \dotm\
functions from its memory so that subsequent calls invoke
the newer versions.


\end{document}




