Home
Research Projects
Classes GEOS 293/393 Hawaii Field Course GEOS 436/636 Beyond the Mouse GEOS 602 Geophysical Fields GEOS 620 Geodynamics GEOS 655 Tectonic Geodesy GEOS 692 Geophys. Seminar
Current & Past Students
Student Opportunities
Curriculum Vitae
Recent Publications
Info for Surveyors
Personal Info

Climb higher, beyond the mouse...


Beyond the Mouse Lecture 2: Fundamentals, Variables

September 5

Instructor: Jeff Freymueller

x7286 Elvey 413B jfreymueller@alaska.edu

TA: Shanshan Li

Last Updated: August 27, 2017

Reading

You should have already read Chapter 2 through 2.6, and Chapter 6.1 through 6.3.

Lecture

Fundamentals, Variables (pdf)

LAB 02

LAB: Variables

Examples

I give a few simple Matlab scripts and a Shell script as examples for how arrays can be used. The sources are available as tar.gz or zip archive.

Exercises (Due Thursday Sep 7, as these are short):

Exercise 1: Text Editors

Understand the "text editor story" by scanning through: http://en.wikipedia.org/wiki/Text_editor. In particular, make sure you understand the difference between a word processor program like Word, and a plain text editor like Notepad. This may seem silly, but it will be one of your most important tools to choose, especially once you're leaving the MATLAB world. A poor choice in that department can make your work less enjoyable. There are many choices! Your assignment is to try out two or three of them. Tell us what you tried, which one(s) you like, and why.

Exercise 2: Data Types.

What datatype would be most appropriate for the following values? Give the reason behind your answer in complete sentence(s). Think about how you would use the data, and how you could access it most conveniently (you can use Matlab datatypes):

a)1, 2.3, true, 'c', 'hi there!'
b)Open a sample text file here: passwd.txt and open it in a Text Editor. Or, if you are on a Linux machine, open terminal window and type

> less /etc/passwd . (type 'q' to exit).

Think of the ':' as a separator of data fields. How would you store such data? How would you store it if you knew that the first field is a the user name and you wanted to access this field using this information to get all usernames at once? Try to solve the problem on paper without having to worry about reading in the values from the file. Just describe in English how you would extract the usernames from these lines. We will learn later how to write code to do it.


Dr. Jeffrey T. Freymueller
Professor of Geophysics
Geophysical Institute
University of Alaska, Fairbanks
Fairbanks, AK 99775-7320

jfreymueller -at- alaska.edu
Phone 907-474-7286
Fax 907-474-7290
Office 413B Elvey