`help matlab demos`

Census

Quake

graf2d

graf2d2

penny

earthmap

fifteen

xpbombs

crulspin

wrldtrv

>> help HELP topics: matlab/general - General purpose commands. matlab/ops - Operators and special characters. matlab/lang - Programming language constructs. matlab/elmat - Elementary matrices and matrix manipulation. matlab/elfun - Elementary math functions. matlab/specfun - Specialized math functions. matlab/matfun - Matrix functions - numerical linear algebra. . . . toolbox/symbolic - Symbolic Math Toolbox. toolbox/tour - MATLAB Tour wavelet/wavelet - Wavelet Toolbox. wavelet/wavedemo - Wavelet Toolbox Demos. For more help on directory/topic, type "help topic".

>> help matlab/elmatand then in that output, we wanted to know how to create random numbers:

>>help rand

So let's make a simple coin flipper:

>> round(rand(1)) ans = 1 >> round(rand(1)) ans = 0 >> round(rand(1)) ans = 1

or, increase your chances, flip 4 at once:

>> round(rand(2)) ans = 0 1 1 0 >> round(rand(2)) ans = 0 0 1 1

What about clearing variables? CLEAR removes all variables from the workspace.

Download and view Professor Rankin's Matlab Guide:

http://www.eas.asu.edu/~rankin/resources/MatLabRev.pdf once you save it to your directory, you will need to type:

`darkwing% acroread &`

that will launch the Adobe Acrobat Reader and then you can open the Matlab guide

Using Matlab For Geological Applications

Working our way through that will be our main effort for our class and lab today.

Save the file to a name and location so you can find it. The file is a postscript file so you can do a number of things to it including

`darkwing% gs figure.ps`

A NEW function we have is the convert command. It is pretty smart and it will easily convert the *.ps to *.gif. NOTE that it only makes a gif file. You have to use ghostscript to make a jpeg:

`darkwing% convert figure.ps figure.gif`

What is important is that the suffixes (*.ps and *.gif) are exactly as shown because that is where convert goes to look and see what you want.

`>> load /export/home2/ramon/glg410matlab/middleton_files/DEWIJS.DAT`

to display the contents:

>> DEWIJS

If you produce your own text file for matlab, ftp it onto darkwing (if you did not produce it there), and then you can do the same to a file with one entry per line:

darkwing% more dates 1993.93584 1993.93858 1993.94132 1993.94406 1993.9468 1993.94954 1993.95228 1993.95502 1993.95776 . . .

>> load dates >>dates 1.9939 1.9939 1.9939 1.9939 . . .You will notice that the formatting is bad. The numbers look like they have changed. Try

`help format`

.then you will see that if you type:

>>format long g >>dates 1993.93584 1993.93858 1993.94132 1993.94406 . . .

Pages maintained by

Prof. Ramón Arrowsmith

Last modified January 18, 2000