Presentation is loading. Please wait.

Presentation is loading. Please wait.

M434/534 Numerical Linear Algebra MATLAB Tutorial Session (Fall 2010)

Similar presentations


Presentation on theme: "M434/534 Numerical Linear Algebra MATLAB Tutorial Session (Fall 2010)"— Presentation transcript:

1 M434/534 Numerical Linear Algebra MATLAB Tutorial Session (Fall 2010)
Teaching Assistant: Osamu Chigira Office: DuSable Hall 370 Phone: Office Hour: Tuesday 9:30am-11:00am Thursday 9:30am-11:00am

2 1. Before writing a code When you click on the icon of MATLAB, on your computer screen the following picture (or something similar to the picture) shows up.

3

4 M-File Click on a button of “New M-File” (it is located under a button of “File”) If you click on “New M-File” button, then you will have the following picture. You need to write your code on the M-File, that is, the small window in the following picture.

5

6 Writing a code All your codes must be written on “M-file.”
If you have questions about basic MATLAB operations, first please try to look it up in MATLAB reference books or the internet.

7 Example of writing a MATLAB code

8 Saving your code You must save your code as the same name as your function name. For example, if your function name is “Euler,” you must save your code as “Euler.m” Also, you need to save your M-file in “work.” Do not save your code in any other folder, for example, “MY DOCUMENT” and so on.

9

10 Saving your code MATLAB automatically selects the folder, whose name is “work,” to save your code, and Files of type, that is, M-files(*.m). All you have to do is to check whether those names are correct or not.

11 How do we run a code? On your Command Window, you will see “EDU>>.” Copy and paste your output, function name and input next to “EDU>>.” Then press “Enter.”

12 Copy your function name from your M-file

13 Paste your function name next to “EDU>>”

14 Then press the enter key to run your code

15 “diary” Use “diary” when you want to make a hard copy of your result.
Your result will be saved in “diary file.” Click “Open file” and choose “All files” in “File of types,” then you can find your result. Type “help diary” on your MATLAB Command Window to see the detail.

16 Example: the case your function name is “demo”

17 To find a diary file of “demo”

18 Computer Labs MATLAB is available at the following computer labs:
FR231, Faraday East (FRL) GH235, Graham (UCL) PM051, PM053 and PM056, Psych/CompSci (CSL) Stevens Annex (SCL)


Download ppt "M434/534 Numerical Linear Algebra MATLAB Tutorial Session (Fall 2010)"

Similar presentations


Ads by Google