Lecture materials
No. | Date | Topics | Lecture Slides | Program Examples | Highly Recommended Reading (Insight) |
---|---|---|---|---|---|
1 | 8/23 Tu | Introduction | Slides | Preface & Software sections. Instructions on how to access the book are in the syllabus. | |
2 | 8/25 Th | Programming basics: Variables, types, I/O, problem solving | Slides | squareSurfaceArea.m | Section 1.1 (Just Plug It In!) |
3 | 8/30 Tu | Conditionals (if-construct) | Slides | strictlyIncreaseQuad.m, cricitalPointLoc.m | Section 1.2 |
4 | 9/1 Th | Conditionals, nested conditionals, logical operators | Slides | minQuadratic.m | Section 1.2 |
5 | 9/6 Tu | For loop | Slides | accumulateUserInput.m, avgShortStick.m | Section 2.1 |
6 | 9/8 Th | While loop | Slides | piCalc_for.m, piCalc_while.m | Section 2.2 |
7 | 9/13 Tu | For loops, while loops, and nested loops | Slides | DrawRect.m, DrawDisk.m, DrawStar.m, drawDemo.m (drawDemo contains the graphics settings you will use for drawing shapes), drawNestedStars.m, drawMoreNestedStars.m | Section 3.1 |
8 | 9/15 Th | Functions | Slides | dotsInRings.m, DrawColorDot.m, Polar2xy.m | Section 5.1 |
9 | 9/20 Tu | More Functions | Slides | polar2xy_out.m, polar2xy_print.m, polar2xy_script.m | Section 5.3 |
10 | 9/22 Th | Vectors (1D arrays) | Slides | numOdd.m, rollDie.m | Section 6.1 |
11 | 9/27 Tu | Vectors (1D arrays) and simulations | Slides | plottingLines.m, growingVec.m, RandWalk2D_mod.m, allLarger.m | Section 6.2 |
12 | 9/29 Th | Linear interpolation | Slides | fadingDisks.m | Sections 4.1, 4.2 |
13 | 10/4 Tu | Vectorized Computation, 2D arrays | Slides | dispMatrix.m, minInMatrix.m | Section 7.1 |
14 | 10/6 Th | More 2D arrays | Slides | Cheapest.m, ShowCheapest.m, drawCelebNetwork.m (uses constructs like cell arrays and char arrays that we have not covered in this class…. yet!) | Section 7.2, 7.3 (both sections are optional—they detail cool things you can do with matrices but most of the important new syntax for matrices is in 7.1) |
15 | 10/13 Th | 2D arrays and images | Slides | babyYoda.jpg, babyYoda_bw.jpg, frameImage.m | Section 12.1, 12.2 |
16 | 10/18 Tu | Working with images (grayscale and color) | Slides | LawSchool.jpg, flipImg.m, flipImg_vectorized.m | Section 12.4 |
17 | 10/20 Th | Char arrays | Slides | blurImage.m, ManTakingPhoto.png | Section 9.1 |
18 | 10/25 Tu | Cell arrays | Slides | aminoAcidCounts.m, getAAIndex.m, getMnemonic.m, LinSearch.m | Section 9.2 |
19 | 10/27 Th | Cell arrays and file input | Slides | names.txt, countPalin.m, file2cellArray.m | Section 11.1 |
20 | 11/1 Tu | Cell arrays and file output (possibly start object-oriented programming) | Slides | drawNCards.m, cell2file_HallExample.m | Section 11.2, (section 8.1 is highly optional but will help with this week's exercise) |
21 | 11/3 Th | Object-Oriented Programming: Objects, classes, and the constructor | Slides | Interval.m, demoInterval.m | Why use object-oriented design? and Role of classes |
22 | 11/8 Tu | Object-Oriented Programming: methods, arrays of object, overriding, and overloading | Slides | Interval.m | No reading (study for the exam) |
23 | 11/10 Th | More Object-Oriented Programming | Slides | Interval.m (you need to write the getWidth method in this file to be able to run widestInterval.m), intervalArray.m, widestInterval.m, LocalWeather (a new class) | UBC Object-Oriented Programming reading. Unfortunately, our textbook does not cover OOP. This OOP tutorial from The University of British Columbia is the best resource I can find if you are struggling with OOP. Ignore any sentences mentioning structs, as we will not cover structs in this course. |
24 | 11/15 Tu | More Object-Oriented Programming: private vs public attributes, inheritance | Slides | Interval.m (with private components), Die.m, TrickDie.m | |
25 | 11/17 Th | More Object-Oriented Programming: inheritance | Slides | See Die.m and TrickDie.m above. | OOP Notes |
26 | 11/22 Tu | Recursion | Slides Recording |
removeChar.m, MeshTriangle.m | Section 14.1 |
27 | 11/29 Tu | Sorting and searching | Slides |
mergeSort.m, merge.m, binarySearch.m, showBinarySearch.m | Sections 14.2, 9.2 |
28 | 12/01 Th | Sorting and efficiency | Slides |
insertSortInplace.m |