Unformatted text preview:

MATH2071: LAB #1(a): PreliminariesIntroduction Exercise 1Starting up Matlab Exercise 2Using a browser to download files Exercise 3Getting help Exercise 4Quitting Exercise 5Lab summaries Exercise 6More on Matlab Exercise 7Matlab files Exercise 8Variables Exercise 9Variables are Matrices Exercise 10Vector OperationsFlow controlM-files and graphics1 IntroductionYou will find instructions for each lab, including this one, on the web, starting from my home page:http://www.math.pitt.edu/~sussmanm . I do not supply copies on paper. Many students find it helpfulto print out copies of the lab instructions b e fore the la b session, although it is not strictly necessary. Duringthe lab session, it is convenient to use the online version because you can “copy-and-paste” instructions fromthe web page directly into Matlab. If you pr e fer, you will find a version of this lab in Adobe pdf formathere.This version of the first lab is intended only for students wh o didnot take Math 2070.There are two versions of the first lab. This version introduces the Ma tlab environment and programminglanguage, and presents the general format of the work you need to hand in. If you have already taken Math2070, this material would be a repetition, so you should take the alter native version of Lab 1(b).This lab will occupy three lab sessions. The firs t session will introduce the mechanics of using Matlab onthe Linux PCs here in the lab. There is some reading to be completed before the second session and you cando that here in the lab or at any other computer with web access. The following two sessions will presentexercises in Matlab use.The discussion that follows assumes that you are basically familiar with using a Unix-like operatingsystems such as Linux, browsing the Web, and, to a lesser extent, using telnet (or ssh) to log in to campuscomputers. The nex t few paragraphs will give a brief introduction to Matlab and explain how to use it andthose aspects of the environment that will be important to doing the labs .2 GradingThe labs roughly follow the material presented in lecture, but are indep e ndent of the homework and otherexercises presented in lecture. Lab grades count as 30% of your course grade.Attendance is not required, but help is mo st readily available during the lab s e ssions.You are enco uraged to work together with other students, but you are expected to provide your owndiary and summary files (explained further below).1Each lab will be given a grade of A+, A, B, or 0. These grades correspond with percentage grades of 99,94, 88, and 0. At the end of the semester, your grades will be averaged and then integrated with your gradein lecture. A student who achieves an A+ on each of the labs will be g iven an overall grade of 100 ratherthan 99. The grading criterion is:A+ The work is correct, or there are only very minor errors.A All portions o f the lab work was attempted and most of it is correct. Some serious errors ar e pres ent.B Not a ll portions of the lab work was attempted.Zero Lab was not s ubmitted.Each lab is due befo re the beginning of the next lab. Labs submitted after the day the following labbegins will have 1% deducted from the grade. An additional perc e nt will be deducted for each further weekthey are late. The final due date for labs 2 through 6 is the last day of classes for the semester, and the finaldue date for labs 7 through 10 will be announced near the end of the semester. Labs that are not submittedbefo re the final due date will be given a grade of zero.3 Starting Up M atlabIn this section you will see how to start up recent versions of Matlab that use the Java windowing interface.These instructions are the same for the Unix and MS-Windows versions of Matlab. I will also give thecommand-line equivalents of many of the commands. These command-line equivalents are valid for allversions of Matlab, and many o f them are valid for the Matlab clone named Octave. Generally speaking,anything you can do using a menu can also be done with co mma nd-line equivalents. You would use theequivalents when writing scripts and the menus when working interactively.1. Start up Matlab by (a) double-clicking the icon on the status bar at the bottom (this is the fifth iconfrom the left in the default configuration, and looks like this:), (b) choosing Matlab from the K (orGnome or Start) menu at the lowe r left corner , (c) choosing “Run Command” from the K (or Gnomeor Start) menu, or (d) typing the command matlab at a command prompt. The first window thatopens is a blank white window named “Shell–Matlab,” and you should minimize it using the dash atits top r ight. The second window is the “splash” that identifies Matla b, and it will go away by itself.Then the main Matlab window will o pen up on your screen. This window will look s omething like thefollowing:2Sometimes, the window will open up containing a large number of warning messages about files missing.These messages are “normal” and can be safely ignored.The default window is divided into a larg e r pane on the right, and two panes, each with identificationtabs at the bottoms, on the left. The right windowpane is a command windowpane and you will betyping Matlab commands in it. On the left side of this command windowpane somewhere (near thebottom in the figure) there will be a prompt of the form >>. Your typed commands go next to thisprompt.There are two choices for display on each of the two windowpanes on the left. I suggest that you choose“Workspace” on the top and “Command History” on the bottom in general, although we will haveoccasion to use “Current Directory” on the bottom.2. It is a good idea to organize your work into dire ctories (or folders–they are the same thing). I suggestthat you do your work in your AFS (Andrew File System) directory. This is the same directory thatunixs uses and it is permanent, unlike the default directory on the computers in GSCC. (Files leftin the default home directory will disappear when you log out!) Use the Matlab “Current Directory”windowpane to navigate to your AFS directory. (Go first to the “Desktop” and then to “AFS” andthen to “private”.) Inside that directory, I sugg e st that you use a directory named math2071 for allthe work in this lab, and subdirectories lab01, lab02, . . . , lab10 for each of the labs. Yo u will needto create these directories before you can use them, and the “Current Directory” windowpane hasthe


View Full Document

Pitt MATH 2071 - MATH 2071 LABORATORY

Download MATH 2071 LABORATORY
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 MATH 2071 LABORATORY 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 MATH 2071 LABORATORY 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?