DOC PREVIEW
UW-Madison MATH 340 - MINIMAT Tutorial

This preview shows page 1-2-3-4-5 out of 15 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 15 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MINIMAT TUTORIALJoel RobbinJune 92The purpose of this tutorial is to give you a feeling for how MINIMATinteracts with the user and what it can do. The tutorial is not intended tobe a definitive account1of anything: MINIMAT’s commands are explainedmore carefully in the sequel. To use this tutorial simply type the indicatedcommands at MINIMAT and compare the output with the text.That portion of the text in this chapter which is actually produced bythe computer is set in typewriter typeLike this.All text typed into the computer by the user appears in typewriter type ona line beginning with the MINIMAT’s prompt as in#> A = [1 2; 3 4]All other text in typewriter type represents output produced by MINIMATas inA = [ 1.000 2.0003.000 4.000 ]1 Before You BeginBefore you use MINIMAT you should make a backup copy using the copycommand from the Operating System. If you are completely new to comput-ers you will have to learn a few things first, like (1) how to turn the computeron and off; (2) how to boot the operating system; (3) how to change the de-fault 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 peculiarto the particular computer system you are using and will not be explainedhere.1You can find a complete account of MINIMAT in the MINIMAT Reference Manual,but most users will find that information in this text together with the online informationaccessible through MINIMAT’s help facility (explained below) is more than adequate fortheir needs.1The easiest way to use MINIMAT is to put all the files on the distributiondiskette 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 donethis.2 Starting UpWe begin the session by typing minimat (followed by [Enter]) at the DOSprompt; this causes DOS to start the MINIMAT program. First MINIMATdisplays a sign-on message. Pressing any key will cause MINIMAT to con-tinue; MINIMAT will continue in any case after three seconds.MINIMAT finds the file mmlogin.m2on the default directory and executes3the commands in that file.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:We press a key and MINIMAT continues by clearing the screen and print-ing the prompt.3 The PromptWhen MINIMAT is waiting for input it issues a prompt:#>If at some p oint in the session MINIMAT has not issued the prompt whenyou think it should, it may be that you have not completed typing the lastline (perhaps there is an open parenthesis). In this case (if you do not know2If MINIMAT does not find this file it will simply print the prompt.3If you press a key while MINIMAT is executing a command, MINIMAT asks you ifyou want to interrupt the calculation. If you respond affirmatively, then MINIMAT printsthe prompt.2how to complete the statement correctly) you may press [Esc] (the escapekey) to recover the prompt. If you press [Enter] before you have typed acomplete statement, the message line at the top of the screen shows whatsymbol is needed to complete that statement.4 Sample SessionWe evaluate some simple MINIMAT expressions and assign them to variables.Note how the variable ans contains the result of the last expression evaluatedwhich was not explicitly assigned to some variable.#> 3*4-1ans = 11.000#> t=rand(1,1), x=cos(t), y=sin(t), x^2+y^2t = 0.557x = 0.849y = 0.528ans = 1.000Note that MINIMAT’s notations are similar to those used in mathematicsand most programming languages like BASIC. It uses the asterisk * to denotemultiplication (if we write AB when we mean A ∗ B, then MINIMAT willthink of AB as a symbol by itself having nothing to do with either A orB). Note also that several statements may appear the same line if they areseparated by commas.3At this point we ask for help.#> 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’+ac=a*b/2c=a+2*c*********************************************** Press the PgDn key to see more. ** Type Alt-x to return to MINIMAT ***********************************************(We show only one screenful of the help facility here.) We type [Alt-X]to return to MINIMAT.At this point we use MINIMAT’s convenient notations to perform Gaus-sian elimination. First we enter a simple matrix:#> A = [ 1 2 3; 4 5 6; 7 8 9 ]A = [ 1.000 2.000 3.0004.000 5.000 6.0007.000 8.000 9.000 ]Next we subtract an appropriate multiple of the first row from the second toobtain a zero in the (2, 1)-position:#> A(2,:) = A(2,:)-A(2,1)*A(1,:)A = [ 1.000 2.000 3.0000.000 -3.000 -6.0007.000 8.000 9.000 ]4We do the same for the third row to produce a zero in the (3, 1)-position:#> A(3,:) = A(3,:)-A(3,1)*A(1,:)A = [ 1.000 2.000 3.0000.000 -3.000 -6.0000.000 -6.000 -12.000 ]We scale the second row to produce a one in the (2, 2)-position:#> A(2,:) = A(2,:)/A(2,2)A = [ 1.000 2.000 3.0000.000 1.000 2.0000.000 -6.000 -12.000 ]We subtract a multiple of the second row from the third to produce a zeroin the (3, 2)-position.#> A(3,:) = A(3,:)-A(3,2)*A(2,:)A = [ 1.000 2.000 3.0000.000 1.000 2.0000.000 0.000 0.000 ]Finally we produce a zero in the (1, 2)-position.#> A(1,:) = A(1,:)-A(1,2)*A(2,:)A = [ 1.000 0.000 -1.0000.000 1.000 2.0000.000 0.000 0.000 ]We use MINIMAT’s what command to find out which .M MINIMAT canfind.#> whatDirectory of C:\MM\*.Mmmdemo.m mmlogin.m intinv.m randsutr.m5rref.m solve.m rrefmul.m randsoln.msignum.m next.m adj.m compan.msourfram.m bed.m rbasis.m nbasis.mWe decide to find out what the .M file rrefmul.m does.#> type rrefmfunction [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);The type command listed the file rrefmul.m on the screen. The com-ments at the beginning of the listing indicate that the function rrefmulaccepts a matrix A as input and produces two matrices R and M as output: Ris the reduced row echelon form of A and M is the matrix which pre-multipliesA to put A into reduced row echelon form.We try it out. We press [Alt-X] to exit the type facility (just as weexited the help facility). Then we enter the same matrix we entered before.#> A=[1 2 3; 4 5 6; 7 8 9]A = [ 1.000


View Full Document

UW-Madison MATH 340 - MINIMAT Tutorial

Download MINIMAT Tutorial
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view MINIMAT Tutorial and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view MINIMAT Tutorial 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?