How to use MATLAB in Undergraduate Computing Lab (2118 Math. Sci. Bldg.)
Written by Naoki Saito ( If you have any question, please send an email
to help@math.ucdavis.edu. )
Things to do before you come to the lab for the first time
-
From your computer at home or some other location, visit Math Department Class Account Page at https://www.math.ucdavis.edu/comp/class-accts.
-
Click the link "Create a lab account" in that page.
-
You can see the list of courses; Select the course name you are enrolling.
-
Enter your last name and your Student ID Number in the specified slots.
-
Push "Add account" button.
-
If you made a mistake, then push "Reset" button and repeat the process.
-
If all the input information is correct, then it displays very important
information, namely, your username and your password.
Record these two in your note.
-
You do not have to change the given password, but if you wish, can change the given password later for your convenience. See
the section of Changing password.
How to login to the computer at the lab
- When you sit down in front of your terminal, shake the mouse to activate the screen. (If nobody has used the computer for 15 min or so, the screen gets automatically blank to save the power and monitor.)
- Then enter your username in the window.
- Then enter your password in the next window.
- The screen is cleared and your initial desktop session shows up.
(If not, your username or password was wrong. Retype these.)
- Click "MATLAB" icon in the stationary desktop menu located on the lower right hand
side of the screen.
- If this brings up a terminal window, which tries to automatically connect to one of our servers, and asks you:
Are you sure you want to continue connecting (yes/no)?
Then, type yes.
- MATLAB window then shows up for your session.
- For the first time users, I would recommend to run "demo" program and explore them by typing demo at the prompt >>.
How to login to the computer from the remote site
- Connect to round.math.ucdavis.edu by ssh (Linux, MacOS) or PuTTY (MS Windows).
-
If you use linux or MacOS machines, your system should have ssh already, so open a terminal and just type:
$ ssh round.math.ucdavis.edu
If you use MS Windows machines, you should download
PuTTY.
- Enter your username and password at the prompt.
- This allows you to login to the departmental computer. Then type matlab
to start your MATLAB session.
How to transfer files from the remote site to the departmental servers and vice versa
- You need a secure version of file transfer software to do this.
- If you are an MS Windows user, install
WinSCP in your PC.
- If you are a linux/unix/Mac user, you should have scp in your system.
- Connect to one of the department servers using the above software tool.
- Then you can transfer your files from your PC to the server or vice versa.
For more details, please refer to online help/manual of each software tool.
How to change your password
- After logging in to the computer, at the prompt, type "passwd" and return.
- The system asks you to enter your old password, your new password.
- When you enter both of them correctly, the system asks you to retype the new password to verify.
- If your retype is correct, this becomes your new password. You should remember this new password!
- If your retype is incorrect, the passwd program doesn't update your password. Therefore, you need to do the "passwd" process again. Until you succeed your password update, the system recognizes your old password.
- Password should be not too simple like abc or davis so that the other people cannot steal your accounts or do harmful things to our computers. You should choose your password wisely.
How to print MATLAB graphics
- Select "File" menu from your MATLAB graphics window.
- Select "Print..." item on that menu list.
- Then, a small window about printing pops up. This is self-explanatory. If you are in 2118 Math. Sci. Bldg., then just push "Print" button in that window. Then, the black and white version of your display will be printed in the laser printer in the lab.
- Alternatively, you can save your graphics and plots as a postscript file.
If you want to do this, then select "File" in "Send to:" option in the window,
first. Then you push "Print" button. Follow the direction of the windows.
Once the postscript file is created, you can copy or move that file to your
own PC or other places where you may have an access to laser writers or
other color printers.
How to use editor to write and save your programs
- Once you get used to MATLAB sessions, you may want to write MATLAB
programs or scripts using editors so that you can save them and modify them
later.
- If you know "emacs", use it.
- If you do not know any editor, you can use "nedit".
- You can invoke this within your MATLAB session;
Type !nedit at the MATLAB prompt >>. (Note that "!" is important)
- You can just type things in this window. When you save the contents,
specify the filename. Very similar to NotePad in MS Windows.
- You can load the saved file to edit or modify the contents later.
Important things to remember
- When you finish your MATLAB session, please logout from the computer regardless where you access the computer.
- To do this, first you quit MATLAB by typing "quit" in your MATLAB session.
- Second, push the left mouse button on the background (i.e., the place in
your display where there is no windows or terminals).
- Then the main menu shows up. Move the pointer to "Logout" item (usually at the bottom of the list).
- This shows submenu. Move your pointer to "Yes, Really Logout"item and click the
left mouse button over there. That should be it!