Unformatted text preview:

Economics 520, Fall 2005Notes on Using Matlab and Octave:For the computational parts of the homework, you should use Matlab or Octave. Matlab isa commercial scientific software package, and is available on the university u-system. It canbe purchased for your own personal use, but is rather expensive for the full-featured version.(I do not recommend the student version of Matlab as it has some major limitations.)Octave is a free (GPL-licensed) program with very similar syntax to Matlab; the sameprogram will usually work with minor modification on either Matlab or Octave. For ourpurposes, either is fine. You may wish to install Octave on your home computer/laptopand use Matlab at school.In this note are instructions on how to:1. Get a u-system account if you don’t already have one2. Access Matlab on the u-system from the economic s graduate lab3. Access Matlab on the u-system from your own computer4. Install and run Octave on your own computer5. Transfer files to and from the u-systemI provide information for users of Linux, Mac OS X, and Microsoft Windows. Please notethat since I don’t use Windows myself, I cannot provide much further information aboutWindows-related issues. (I have verified that access to the u-system from the economicsgraduate lab computers works fine.)1 U-System AccountGeneral information about the u-system can be found at:http://www.u.arizona.edu/You should have a UA NetID (https://netid.arizona.edu/), then add a u-system ac-count at https://account.arizona.edu/When you first log in to the u-system, you will be presented with a choice b e tween usingthe menu interface and the shell interface. To use matlab you want to be in the shellinterface. If your account is set up to automatically put you in the menu interface, followthese directions to change to the shell:http://consult.web.arizona.edu/menu2shell.html12 Accessing Matlab on the U-system from the EconomicsGraduate LabNote: if you are planning to ac ce ss the u-system from your own computer, please read thissection anyway as it contains some useful information.I recommend you first try a non-graphical session, then move on to a graphical sessiononly if you need it. Graphical sessions can be slow depending on the speed of the networkconnection.2.1 Non-graphical session1. Click on the Start Button, and find the Secure Shell Client.2. Click Quick Connect on the Secure Shell Client window. This will call up a windowthat asks for the following information:hostname: u.arizona.eduusername: <your username on the u-system>port #: 22authentication method: passwordEnter this information and proceed to log in.3. After logging in to the u-system, make sure you are in the shell (not the menu), andtype setup matlab14 at the prompt (you will only need to type this the first timeyou try to start Matlab). Then type matlab -nojvm at the prompt. This should startup a session that looks like this:> matlab -nojvm< M A T L A B >Copyright 1984-2003 The MathWorks, Inc.Version 6.5.1.199709 Release 13 (Service Pack 1)Aug 4 2003Using Toolbox Path Cache. Type "help toolbox_path_cache" for more info.To get started, type one of these: helpwin, helpdesk, or demo.For product information, visit www.mathworks.com.>>At the prompt, you can start typing in commands.22.2 Graphical SessionThe following instructions are based on the information inhttp://www.u.arizona.edu/udocs/display.html1. First, we need to make sure eXcursion is correctly configured. Click Start, go to Al lPrograms, find eXcursion, then Control Panel. Or, if eXcursion is running, findit on the taskbar and right-click it and choose Control Panel.2. Click the Display tab and set Multiple Windows.3. Click the Access tab. Check the Enable Access Control box.4. In the access tab, check to see if “TCPIP loc alhost *” and “TCPIP u.arizona.edu*” are listed under “Existing Nodes.” If they are not, then under Node Name add“localhost” and click the Add–¿ button, then add “u.arizona.edu” under Node name.5. Click Apply, then the Start/Restart Server button at the bottom of the eXcursionControl Panel. Hosts6. Start SSH Secure Shell but do not actually connect yet. You need to define an SSHProfile for your connection.7. Under the Profiles pulldown, select Add Profile. Enter a name for your profile,such as <yourname>@u-sys.8. Next, under the Profiles pulldown, select Edit Profiles. Select the profile name youjust created, and in the Connections tab make sure that the Host Name is s et tou.arizona.edu and the User Name is set to your username. Then click the X11Tunneling tab, and check the Tunnel X11 connections box.9. Finally, save the changes, and use the Profile pulldown to select the Profile you havejust named and configured. Enter your password when prompted.If all goes well, you should be logged in to the u-system. To tes t if X is working, try typingxclock & at the prompt. This should pop up a graphical clock window.Next, at the shell prompt, typematlab -nojvmThis will start a matlab session with graphics. You will see the same screen as in thenongraphical session. Try typing the following commands at the >> prompt:>> x=randn(100,1);>> plot(x)This should pop up a new window labelled “Figure No. 1” with a graph in it. (There maybe a slight wait for the window to pop up.) That indicates that the graphics are beingexported to your local display. To quit, type quit at the >> prompt.Alternatively, you can use a java-based matlab session, by typing matlab & from the shell.I don’t recommend using this mode as it seems to be very slow.33 Accessing Matlab on the U-system from your own com-puter:In order to access Matlab on the u-system you need an SSH client (for terminal sessions) ,an SFTP client (for file transfer), and optionally, an X client (for graphical output).3.1 LinuxYou already have SSH, SFTP, and X. Open a terminal window, and connect to the u-system using ssh -l <username> u.arizona.edu for a non-graphical session, or ssh -X-l <username> u.arizona.edu for a graphical session. Here <username> is your username on the u-system. Once you are logged in, follow the instructions from Section 2 toset up and start Matlab.3.2 Mac OS XYou already have SSH and SFTP. X11 is an optional part of Mac OS X, and can be installedfrom your system disks, or downloaded fromhttp://www.apple.com/macosx/features/x11/download/.For non-graphical access, you don’t need X11. Open the terminal application, which isin the Applications: Utilities folder. Type ssh -l <username>


View Full Document

UA ECON 520 - Study Notes

Download Study Notes
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 Study Notes 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 Study Notes 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?