Filename: readme.w32 (also readme32.txt) Revision Date: August 4, 2009 MLAB Installation and Operation Guide This is the installation guide for the Windows 95/98/NT/2000/Me/XP/Vista 32-bit version of MLAB. MLAB also exists in DOS 640K overlay, DOS extended-memory flat model, 16-bit Windows 3.1, Intel-Linux, Motorola Macintosh, and PowerPC Macintosh (OS9 or earlier), Native OSX Macintosh (both PPC and Intel), and several UNIX versions. You may have purchased either a full unlimited lifetime MLAB system or the 90-day trial version with manuals, or you may have downloaded the web-trial version from our web-site. These systems differ only in their lifetime built-in to the software. Each such system will be called MLAB here. As of Aug. 4, 2009, the Windows 32-bit MLAB system consists of three books and a collection of files packed in a Winzip self-extracting zip-file "package" file (zmlab.exe) which is downloaded from www.civilized.com. The books are: MLAB Reference Manual MLAB Applications Manual MLAB Graphics Examples MLAB Users Guide (out-of-print) The files in the zmlab.exe package file are: README32.TXT (This file) setup.exe MLAB installation program init0.fil Secondary MLAB initialization file token.fil MLAB token file dw.sav MLAB defaultwindow save file init.sav MLAB initialization file mlab.hlp MLAB DOS-style help text file mlabref2.hlp MLAB Windows-style help file gxfonts.0 MLAB stroke font file license.key MLAB authorization file dimer.do An example MLAB do-file for study mlab.exe MLAB executable program startup.do an MLAB do-file which is executed automatically when starting MLAB startup.dat a data file for startup.do EXAMPLES sub-directory containing example MLAB .do and and .dat files [in the EXAMPLES directory are 27 do-files for study and tutorial use: mlabex.do lrcex.do windkex.do kmestex.do hhdoex.do dimerex.do holfex.do enzymex.do gcrex.do ndiskex.do liglex.do centriex.do payex.do vorex.do ttestex.do fnpex.do dcaex.do djiaex.do conex.do snsptex.do laserex.do ctnryex.do henonex.do minmodex.do torex.do magnetex.do mlabex1.do and 10 dat-files (data files) used by the tutorial do-files: kmestex.dat gcrex.dat a3azt.dat divisor.dat sunspots.dat slm.dat recssm.dat recssd.dat test.dat molex.dat ] LICENSING By installing MLAB, you agree to not use any parts of the MLAB files or manuals, modified or unmodified, as parts of any products without permission. You agree to register and use MLAB on one computer per license purchased. SYSTEM REQUIREMENTS Please verify that your PC is hardware and software compatible with MLAB. 1) CPU. The chip must be an Intel 80386, 80486, Pentium, or Pentium II. Pentium Pro, Pentium III, Pentium 4, and on and on. any Intel-compatible clone chip such as an AMD should work, but we have not tested them. 2) Floating Point Math. The PC MUST provide hardware floating-point processing. Pentium and 80486DX CPUs have this built in. 386 or 486SX machines require a separate 80387 or 80487 math coprocessor chip. MLAB will not operate with a non-IEEE standard 754 floating point chip such as a Weitek chip. 3) Hard Disk Space. There must be at least 4.5 Mbytes available for the MLAB files. At least a megabyte of additional space for user files is convenient as well. 4) Video. The graphics board and associated VGA monitor must provide at least 640 by 480 resolution with 16 colors. Although we think any Windows graphics model can be used, we know that a 1024x768, 65K color non-palette device works. 5) RAM. No special memory recommendation is needed, beyond that usually required for a mix of applications. INSTALLATION DIRECTIONS 1) Download the MLAB package file zmlab.exe from www.civilized.com. (Any location on the disk will suffice, since the winzip unpacking program will ask where you want the MLAB directory to be located. DO NOT have your browser set to automatically "open" or "run" this downloaded file!) 2) Run the the self-extracting package file zmlab.exe by any means you have to do so. Double-clicking on the file name in a directory listing will generally work. This will unpack the various MLAB files into the top-level directory \MLAB\ (or into any directory that you specify,) the winzip unpacking program will then run the program setup.exe provided within the package file (You must let setup be run automatically from the winzip program - do not turn-off the automatic running of setup in the winzip control window.). The self-extraction winzip program will ask you to specify the logical hard drive, e.g. c:, and the name of a directory in which the MLAB files are to be placed. (The setup.exe installation program provides a small window where you may specify the directory that you desire.) If you just type "Enter" and do not specify a logical hard drive and directory, MLAB files will be installed on the logical hard drive c: in the directory "\MLAB\". We recommend this location, although if you have MLAB pre-existing on your disk in some directory, it might be wise to install the new MLAB files in a different directory or rename the old directory, although you can overwrite the old files with a new install. Then, the compressed MLAB files will be decompressed and placed in the specified directory on the specified logical hard drive, and the setup.exe program will then be run. On a Windows 2000 or Windows XP system, a window may pop-up (if you are not logged-in as "Administrator") asking if you want to do the install as "Administrator". DO NOT DO THAT! You must do the MLAB install as the user who will subsequently have a desktop shortcut icon for running MLAB. That user can be "Administrator", but, you CANNOT switch to "Administrator" during the Winzip unpacking process! 3) During the installation, a window describing the MLAB program group will appear. (A program group is just three small files in some directory.) This program group window includes icons for three .lnk files: 1) the MLAB application (mlab.exe), 2) README32.TXT, 3) MLAB Language Reference (a MSWindows help-system file). Please double-click on the "README32.TXT" icon to get additional information (i.e. this file). Then you will want to "close" this program group window by clicking on the X in the upper right corner of the window. The MLAB System is now installed! If you requested it, you will find a 'shortcut' icon for the newly-installed MLAB program on your 'desktop'. You will need to strike a final "enter" key to finish the installation. Then you should close all the windows that are on the screen, and look for the MLAB icon on the the desktop from which you can run MLAB. MLAB can only be installed using this installation procedure; copying files directly will not work! Creating a Short-cut Icon It is easiest to run MLAB from a shortcut icon on the desktop. If you requested it, and if setup worked, then the setup program has created a shortcut icon on your desktop. You can run MLAB by double-clicking on this icon. If it is not present, or if you should lose this shortcut icon, you can create it as follows. Double-click on the MyComputer icon, select the C: drive, and then the MLAB folder to display the contents of the MLAB folder. Then click the right mouse button on the MLAB.EXE file icon and select [CREATE SHORTCUT] from the resulting menu. The shortcut icon (which is a small file) will appear in the MLAB folder window; you may now drag and drop this icon into your "desktop" screen area (i.e press the left mouse button down and hold it while "dragging" the mouse to an open space in your "desktop" area, and then release the depressed mouse button); the MLAB shortcut icon will remain there thereafter. Registering MLAB (*) When you have run MLAB several times, you will be asked to register MLAB with Civilized Software. In particular, you will be asked to enter an authorization key-value to register MLAB, or to enter zero if you do not (yet) have your authorization key value. (If you have a limited-lifetime trial version, you are prompted to purchase MLAB; following which you can register it.) When you enter 0, MLAB will report your "MLAB identifier value", and then proceed to run by displaying the start-up menu (from which you can view some examples of MLAB computations.) As you continue to use MLAB and enter 0 for your authorization key-value, this process will be repeated, and you will be able to use MLAB until it expires, which is generally 30 days or more from your initial installation. At expiration, your MLAB identifier value will still be reported to you, but MLAB will not run after that until you contact Civilized Software and "trade" your MLAB identifier value for an authorization key-value. You can install MLAB on as many computers as you wish, but if you want to register MLAB with an unlimited lifetime on a computer that would exceed your licenced number of registered copies, you will be required to uninstall MLAB from an existing registered computer. Directions on how to proceed are as follows. 1. Call or email Civilized Software and notify us that you are moving your registered copy of MLAB to a new machine. 2. Run MLAB on the current machine it is installed on, and enter the command "-INSTALLMLAB" and record the uninstall code that is reported to you. This copy of MLAB is now disabled can not be run after this, unless it is re-registered there. 3. Install MLAB by downloading the trial version, on the new machine. Run it a few days and obtain the MLAB identifer value for that install. 4. Call or email Civilized Software and report both your uninstall code and the new MLAB identifier value. We will return to you the necessary authorization value for you to register MLAB on this new machine. Please call Civilized Software (301-962-3711); or email us at csi@civilized.com if you have any problems. RUNNING MLAB To run MLAB, double click on the MLAB icon in the MLAB program group, or execute MLAB by selecting MLAB from the Start button/Programs/MLAB option, or double click on the MLAB shortcut icon. Running MLAB will open a moveable, scrollable (via the arrow keys only), and unresizeable window titled "MLAB" on the screen. MLAB then prints the date, the time, and the user's name in the MLAB window, and prompts you to register MLAB if applicable. (The first time you run MLAB, it will ask for the user's name, which will be printed at startup thereafter.) MLAB then executes the script startup.do. startup.do posts a menu with 3 choices in the MLAB window. The three choices are: 1) running example DO-files corresponding to certain chapters in the MLAB applications Manual, [YOU SHOULD LOOK AT SOME OF THESE EXAMPLES WHEN YOU FIRST EXPLORE MLAB!!!!!] 2) going to top level MLAB, and 3) display some tips on using MLAB. If you select the first option to view some examples by striking the ENTER key or clicking CONTINUE, a brief dialog of instructions is displayed. Click on the CONTINUE button and another menu with a list of example topics will appear. You can then choose a topic with the mouse or the UP and DOWN arrow keys and execute the corresponding DO-file by striking the ENTER key or clicking CONTINUE. Another choice is to go to a top-level MLAB prompt to do your work, but, when you first start using MLAB, you should study a few examples before you do that. When you opt to "go to" top-level MLAB, MLAB prints an asterisk (*) in the MLAB window. The asterisk is the command prompt--that is your cue to type MLAB commands. You should quickly get in the habit of constructing do-files containing MLAB commands that can be easily repeated and easily changed. You do this by typing: `EDIT FILE xxx'. After you have written a do-file, you will execute it by typing `DO xxx'. [Detailed directions on how to construct a do-file are given below!] !!!!!!!!!!!!!!!!!!!!!!!!!! It is VERY IMPORTANT to go to www.civilized.com and look at (and print-out) the 'short MLAB manual' found there. !!!!!!!!!!!!!!!!!!!!!!!!! Here is a brief introduction to using MLAB. 1. MLAB as a calculator. ======================== MLAB can be used as a calculator. As with most computer languages, + is used for addition, - is used for subtraction, * is used for multiplication, / is used for division, and ^ is used for exponentiation. Numbers may be entered as integers, floating point numbers with a decimal point, or in scientific notation. All numbers are converted to 64-bit, double precision, floating point numbers. Note that MLAB does not directly support complex numbers. The precedence of operations evaluated from right to left in an expression, from highest precedence to lowest precedence, is: exponentiation, division, multiplication, subtraction, and addition. Parentheses (), square brackets [], and curly braces {} may be used pairwise to alter the natural order of evaluation. The variable PI is automatically defined in MLAB to be 3.14159265. For example, following the asterisk prompt, type: 6.02E23*1*10/(.0812*276) where means the Enter or Return key on the keyboard, and expect to get back = 2.68615692E23 and another asterisk. This is the number of atoms of an ideal gas in a 10 liter volume at standard temperature and pressure as given by the ideal gas law. In all that follows, we shall omit the , but you should not, because otherwise nothing will happen. If your command is defective, MLAB will issue a diagnostic message. If you hit the UP ARROW key once, the last command will be printed on the command line. You may then use the LEFT and RIGHT ARROW keys to reposition the text cursor and edit the errant command. MLAB also has the capabilities of a high powered caluculator. 2. MLAB as a high powered calculator. ===================================== There are tens of thousands of potential memory registers. Type: X1=8; X2=3; DX=X1-X2; These three statements assign numerical values to variables X1, X2, and DX. Note several MLAB commands can be typed on the same line if each command is separated by a semicolon (;). The name of a variable begins with a letter and may be followed by as many as 16 alphanumeric characters. If the MLAB system variable CASESW is set equal to 1, MLAB will distinguish between upper and lower case letters. The value of one or more variables may be printed by using the TYPE command. For example, type: TYPE X1,X2,DX results in: X1 = 8 X2 = 3 DX = 5 MLAB supports vector and matrix variables, too. To define a column vector named V containing ten zeroes, use the row-wise replication operator ^^ by typing: V = 0^^10 Different values such as 1.2, 1.9, 2.6, -3.2, 6.5, and 7, may be assigned to a column vector by using the LIST command as follows: VC = LIST(1.2,1.9,2.6,-3.2,6.5,7) To store an ordered sequence of numbers in a column vector, you may use the (start:end:step size) operator, for example: V1 = 2.4:9.6:1.2 stores the values (2.4,3.6,4.8,6,7.2,8.4,9.6) in column vector V1. Alternatively, you may use the (start:end!number of steps) operator, for example: V2 = 2.4:9.6!7 which stores the same numbers in column vector V2. A column vector may be converted to a row vector by using the apostrophe as a transpose operator, for example: VR2 = V2' defines VR2 as the transpose of V2. Matrices may be defined from vectors by using the SHAPE operator. SHAPE takes three arguments: the first argument is the number of rows in the result matrix, the second argument is the number of columns in the result matrix, and the third argument is the name of the vector of values which are read row wise. For example, type M = SHAPE(3,2,V2); TYPE M MLAB responds: M: a 3 by 2 matrix 1: 2.4 3.6 2: 4.8 6 3: 7.2 8.4 The values of a matrix may be read from an ASCII text file in the current working directory by using the READ command. For example, M = READ(DATVAL,4,3) will open the file "DATVAL.DAT" in the current working directory, read four rows of three floating point values from that file, and store them in the matrix M. Specific elements of a matrix may be assigned by using subscripts. For example, typing: M[3,1] = 6 changes the element of matrix M in the first column of the third row to the value 6. The elements of an entire row of a matrix may be assigned by using the ROW keyword; for example, M ROW 2 = LIST(7,9)' The keyword COL may be used in a similar fashion. Note that if a matrix must be enlarged to define an element, row, or column, then undefined elements are initialized to zero. For example, if MM has not been defined and one types: MM[3,4] = 6; TYPE MM MLAB responds with: MM: a 4 by 4 matrix 1: 0 0 0 0 2: 0 0 0 0 3: 0 0 0 6 The scalar arithmetic operations carry over to matrix operands: + and - performs element by element addition and subtraction, and * performs row by column matrix multiplication. The Moore-Penrose inverse of a matrix can be found by typing: M^(-1) The eigenvalues and eigenvectors of a square matrix can be found by typing: EIGEN(M) The selection of basic built-in functions offered by MLAB is far more extensive than what is offered by any calculator. These include: SIGN(X) - the sign of the value stored in variable X INT(X) - the integer part of the value stored in variable X MOD(X,Y) - the integer remainder after dividing the value stored in variable X by the value stored in variable Y ABS(X) - the absolute value of the value stored in X SQRT(X) - the square root of the value stored in X EXP(X) - the exponential of the value stored in X LOG(X) - the natural logarithm of the value stored in X SIN(X) - the trigonometric sine of the value stored in X (radians) COS(X) - the trigonometric cosine of the value stored in X (radians) TAN(X) - the trigonometric tangent of the value stored in X (radians) Trigonometric functions with arguments given in degrees are computed by adding a D to the function name (i.e. SIND(X) is the trigonometric sine of the value of variable X in degrees); hyperbolic trigonometric functions are computed by adding an H to the function name (i.e. TANH(X) is the hyperbolic tangent of the value of variable X in degrees). There are also many statistical distributions, density, and random number generator functions. For example, GAUSSF(X,Y,Z) - the value of the normal distribution function for random variable value X, mean value Y, and variance value Z STUTF(X,Y) - the value of the Student's T distribution function for random variable value X, and degrees of freedom value Y QFF(X,Y,Z,W) - the value of the F distribution function for random variable value X, numerator degrees of freedom value Y, denominator degrees of freedom value Z, and noncentrality value W You may define your own functions by using the FUNCTION statement (FUNCTION may be abbreviated FCT). Note the FUNCTION statement can only be used to define a function of one or more variables that returns a scalar; it is not possible to define a function that returns a vector or a matrix. For example, you can define a quadratic function of one variable, X, and three parameters, A,B, and C, and evaluate it by typing: FCT Q(X) = A*X^2+B*X+C A=3; B=2; C=-1 Q(3) The result is: = 32 You can evaluate a function at a number of independent variable values by using the ON operator. For example, type: Q ON 1:10 to evaluate the function Q(X) at X = 1,2,...,10. You can create a table of independent variable and function values by using the POINTS operator as follows: POINTS(Q,1:10) The POINTS operator takes a function name as its first argument and a vector of independent variable values as its second argument. It returns a two-column matrix, with independent variable values in the first column and the corresponding function value in the second column. MLAB can also evaluate derivatives of functions. Simply type an apostrophe and the name of the independent variable following the function name to take the derivative of the function with respect to the independent variable. For example, to take the derivative of the previously defined quadratic function with respect to X, type: TYPE Q'X MLAB responds: FUNCTION Q'X(X) = 2*X*A+B You can evaluate the derivative at the point X = 3 by typing: Q'X(3) to which MLAB responds: = 20 You can also use MLAB for curve-fitting. 3. Curve-fitting with MLAB. =========================== By curve-fitting in MLAB we mean estimating parameters that appear in a function of one or more independent variables so that the sum of, perhaps weighted, squared differences between the function value and some data is minimized and optionally specified constraints on the parameters are honored. Curve-fitting is achieved by using the FIT statement. The following statements demonstrate how to fit a cubic function to the four data points (-3,7), (5,4), (3,2), and (14.3,8), with the fourth data point given three times the weight of the first three data points. In what follows, comments that explain intent but are ignored by the MLAB command parser are delimited by /* and */: DT = SHAPE(4,2,LIST(-3,7,5,4,3,2,14.3,8)) /* define data matrix */ FCT F(X) = A*X^3+B*X^2+C*X+D /* define model function */ A=1; B=1; C=1; D=1; /* provide initial guesses for paramter values */ CONSTRAINTS E={A<2,B>0} /* define constraints on parameters */ WGTS = LIST(1,1,1,3) /* define optional weights for each data point */ FIT (A,B,C,D), F TO DT WITH WEIGHT WGTS CONSTRAINTS E To this series of commands, MLAB responds with: final parameter values value error dependency parameter -0.0161618283 4.465259163e-18 0.9996146809 A 0.309975808 6.9381617e-17 0.9996754586 B -0.687876879 8.657812469e-17 0.9599217076 C 1.7102177283 8.088386603e-16 0.949758177 D 7 iterations CONVERGED best weighted sum of squares = 1.972152e-31 weighted root mean square error = 4.440892e-16 weighted deviation fraction = 3.402982e-18 R squared = 1.000000e+00 no active constraints In this printout, MLAB gives the best parameter values, the standard deviation of parameter values (error), the dependency, the best weighted sum of squares and other statistics. For more information on the fit statistics, see the "MLAB Applications Manual". MLAB also has an extensive repetoire commands for creating scientific graphs. 4. MLAB as a graphical calculator. ================================== To generate a graph of the data and the cubic function fit above, we use the DRAW and VIEW commands in MLAB. To draw the data points, give the command: DRAW DT LINETYPE NONE PT CIRCLE This specifies that the data points in DT should not be connected by any line segments (LINETYPE is NONE) but should be drawn with the circle POINTTYPE (abbreviated PT). To draw the fitted function, give the commands: FP = POINTS(F,-3:15) DRAW FP COLOR RED The first statement evaluates the function F at x-values = -3,-4,-5,...,15, and stores the x-values in column 1 and the corresponding function values in column 2 of the matrix FP. The subsequent DRAW statement draws line segments in the color red between each of the (x,y) coordinate pairs. Generally, the DRAW command takes a two or three column matrix as its first argument, followed by LINETYPE, POINTTYPE, COLOR, and LABEL clauses. A title can be given to the graph by typing: TOP TITLE "Cubic fit of data" FONT 7 MLAB also has: LEFT TITLE, RIGHT TITLE, and BOTTOM TITLE commands. MLAB offers 34 different character fonts; FONT 7 specifies the seventh one. To make the graph appear on the screen, give the command: VIEW The command "VIEW" opens and gives focus to a second window called "MLAB Graphics" which contains the graph. The MLAB Graphics Window can be enlarged to fill the entire screen by clicking on the zoom icon in the upper right corner of the window. Striking any key or clicking the mouse anywhere on the MLAB console Window will shift focus back to the MLAB console window. Typing the command UNVIEW or clicking the mouse on the "X" in the upper left corner of the MLAB Graphics Window will cause the MLAB Graphics Window to disappear. Next try typing the command RESET This will free all MLAB memory used since the beginning of the MLAB session. You can also solve systems of ordinary differential equations with MLAB. 5. Solving ordinary differential equations with MLAB. =================================================== To clear previously defined scalar and matrix variables, functions, and graphics elements, type the command: RESET In order to solve an arbitrary ordinary differential equation of order m over a range of independent variable values, MLAB requires that you specify the m-th order derivative in a FUNCTION statement with lower order derivatives and functions of the independent variable on the right hand side; specify the initial values of the solution function and its first (m-1) order derivatives in m INITIAL statements, and specify the range of values of the independent variable in an INTEGRATE statement. For example, to solve Newton's equation of motion for a mass falling under the force of gravity from 10 meters above the ground and zero initial velocity, one can use the following statements: FCT Y''T(T) = -9.80 /* acceleration as the 2nd derivative */ INITIAL Y'T(0) = 0 /* zero initial velocity */ INITIAL Y(0) = 10 /* initial position */ YP = POINTS(Y,0:5:.05) The resulting matrix, YP, contains the time values 0,.05,.1,.15,...,5 in column 1 and the corresponding vertical positions of the mass in column 2. Note that MLAB automatically transforms the second order differential equation into two first order differential equations. You may also solve systems of differential equations by using the INTEGRATE statement in MLAB. As an example, we can solve Newton's equation of motion for a mass falling in two dimensions where there is only gravitational force acting on the mass in the y-direction, and an initial velocity in the x-direction of .1 meters per second, by adding the following statements to those above: FCT X''T(T) = 0 /* zero force in the x-direction */ INITIAL X'T(0) = .1 /* initial speed in the x-direction */ INITIAL X(0) = 0 /* initial x position */ XY = INTEGRATE(X,Y,0:5:.05) After the INTEGRATE statement completes, the matrix XY contains the functions and all derivatives at the times 0,.05,.1,...,5. To determine which column of the matrix XY corresponds to which function or derivative, type out the variable string ODESTR as follows: TYPE ODESTR MLAB will respond with: ODESTR = T X'T X'T'T X X'T Y'T Y'T'T Y Y'T One can then draw a trajectory of the mass with the following commands: DRAW XY COL (4,8) VIEW "VIEW" displays a window titled "MLAB Graphics" which contains the graph. This window can be moved or resized by using the mouse. Striking any key or clicking the mouse anywhere on the MLAB text window will shift focus back to the console window. 6. Using the MLAB PLOT Command. ============================== To create a printable PostScript file containing a copy of the graphics image in the MLAB Graphics window, type PLOT MLAB responds PLOT file is mlabp0.ps This means MLAB has created a file named "mlabp0.ps" in the working directory (usually this is C:\MLAB\). This file contains PostScript instructions which define a full page rendition of the image that was in the graphics window. ----------------- This ps-file may be viewed and edited by launching a PostScript file viewer program such GSview or AdobePhotoshop, and opening the MLAB plot file (i.e. MLABP0.PS) from the PostScript file viewer program's FILE menu. This ps-file may be printed on a PostScript printer by typing the command: PRINT FILE mlabp0.ps or by opening a DOS-Command Window, changing the current directory to the directory where the ps-file is located (i.e. "CD \MLAB"), and typing a PRINT command (i.e. "PRINT MLABP0.PS") or a COPY command (i.e. "COPY MLABP0.PS LPT1") assuming the printer can process PostScript files and is configured as the first printer on the parallel port. This ps-file may be embedded in a MSWord "document" .doc file by the following steps: 1- edit the PostScript .ps file with an ASCII editor such as Notepad; This ps-file may be embedded in a MSPowerPoint .ppt file by ... ----------------- Typing Alt-PrintScreen (the "printscreen"-key is at the top of the keyboard) "grabs" the "active" window and saves it as a bitmap in the "clipboard". If you want the whole screen to be grabbed as a bitmap, then you just type the "Printscreen'-key by itself. You can then run any program which knows how to access the clipboard for a bitmap and use it in some defined manner. For example, to embed the bitmap you have saved in the clipboard in an MSWord .doc file, you run MSWord and explicitly or implicitly "open" the file you wish to embed the bitmap in. Then you click on "Edit" to display the 'edit'-menu, and then select 'Paste' to embed the bitmap in the clipboard in your .doc file at the point where your text cursor is. Of course, you must save the file back to disk for this embedding to have any effect. ----------------- 7. DO-FILES =========== Lists of MLAB commands stored in a plain text file--called a DO-file--can be executed within MLAB. !!!! BUILDING DO-FILES IS THE PREFERRED WAY FOR YOU TO USE MLAB! There is an example do-file called DIMER.DO in the C:\mlab directory (or wherever you installed MLAB.). You should print that file and study it. You can also execute this file as a text exercise. To do this, run MLAB, and establish the mlab-installation dire4ctory as your working directory (by typing FILEDIR = "C:\mlab"). Then type DO DIMER This will execute the script do-file called DIMER.DO which fits rate constants in a system of reaction rate equations to some data and draw a graph. Once the script is finished executing, you can review the history of the commands in the MLAB session by using the UP arrow key, DOWN arrow key, PAGE UP key, PAGE DOWN key, HOME key, and END key to reposition the text cursor (the text cursor is an underscore symbol '_'). If you strike the F1 key while the text cursor is within an MLAB command word or built-in function name, the Windows help system will provide information about that text. If you strike the INSERT key, the entire line of text where the text cursor is positioned will be copied into the command buffer and presented at the bottom of the MLAB console window for editing. Additional help is available by typing HELP at the command prompt. You can edit the DIMER.DO script by typing EDIT FILE DIMER.DO This will invoke the Windows Notepad editor. You can exit the Notepad editor by selecting EXIT from the FILE menu with the mouse. Any file can be edited in the same way. Thus, to create your own do-file, MYFILE.DO, you just type the MLAB command EDIT FILE MYFILE.DO DO-files and DAT-files for a number of the topics covered in the MLAB Applications Manual are included in the \EXAMPLES sub-directory. MLAB execution of a command may be interrupted by simultaneously holding down the CTRL and SHIFT keys and striking the BREAK key. To conclude an MLAB session, either double-click the mouse on the upper left corner of the MLAB window or type EXIT This will close the MLAB log file and all MLAB windows, and terminate the application. ------------------------------------------------------------------------- MLAB FILES During an MLAB session, any of several files may be required or produced: 1. there may be scripts of MLAB commands, called DO-files. The DO-files called MLABINIT.DO and STARTUP.DO, if they exist, are automatically executed each time MLAB runs. 2. data objects may be saved by issuing the SAVE command. This creates save files with the extension SAV. 3. ASCII coded versions of data objects for export to other programs may be generated by issuing the PRINT command. This creates files with the extension LST. 4. graphics files suitable for printing on PostScript printers may be made by issuing the PLOT command. This creates files with the extension PS. 5. finally, MLAB always creates a log file of all commands and responses in an MLAB session called MLAB.LOG. MLAB0.LOG, MLAB1.LOG, and MLAB2.LOG are the log files for the previous three MLAB sessions. These files will all reside in the working directory. A working directory may be set by creating a new directory with the FILE MANAGER and then typing the path and name of the directory in the working directory field of the PROPERTIES associated with the MLAB program icon via the PROGRAM MANAGER. If no working directory is specified, the working directory will be the directory specified during the installation process. The working directory may also be changed during an MLAB session by assigning the variable FILEDIR a quoted string that is the path and name of the desired directory. These awkward manouvers are necessary because Windows does not provide the equivalent of the CD (change-directory) command. TECHNICAL SUPPORT Please contact Civilized Software if you have any problems. Voice: (301) 962-3711 Email: knott@civilized.com Address: Civilized Software Inc., 12109 Heritage Park Circle, Silver Spring, MD 20906, (USA). end of readme32.txt