Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review Make sure current directory is set properly Create a diary

Similar presentations


Presentation on theme: "Review Make sure current directory is set properly Create a diary"— Presentation transcript:

1 Review Make sure current directory is set properly Create a diary
» diary test.txt Create a vector » vec1 = [2 4 6] Create another vector » vec2 = [ ] Multiply term by term » vec3 = vec1*vec2 » vec3 = vec1.*vec2 Close diary » diary off Engr 0012 (04-1) LecNotes 03-01

2 Scripts MATLAB scripts (m-files) are programs
Useful whenever a calculation or computation is done repeatedly Provide power that makes MATLAB more useful than a handheld calculator Engr 0012 (04-1) LecNotes 03-02

3 Script Organization 1. Header (comment) section that identifies purpose of script and information about creator(s) of script 2. Variable dictionary 3. (Optional) format command 4. Display header information to screen (disp commands) 5. Input section (input commands) 6. Computation section 7. Display results section (disp or fprintf commands) Engr 0012 (04-1) LecNotes 03-03

4 Script Creation 1. Edit diary file that has successfully solved problem 2. From scratch using program design methodology - more common Engr 0012 (04-1) LecNotes 03-04

5 Class Activities 1. Workshop 04 - Workspace management
2. Workshop 05 - Intro to Scripts Turn in at start of next class (Monday 8 September) MATLAB Workshop 05: Exercise 3. paper copy of script and screen printout of script working with h = 12.3 cm Engr 0012 (04-1) LecNotes 03-05


Download ppt "Review Make sure current directory is set properly Create a diary"

Similar presentations


Ads by Google