Introductions
  • How to get the most from this course
  • How to use the Q&A forum
  • MATLAB and Octave
  • What is debugging and what is programming style?
Download all course materials
  • How to get the MATLAB files
The MATLAB desktop environment
  • The MATLAB desktop environment
  • MATLAB as a calculator, colon operator
  • Solve some MATLAB exercises!
Variables
  • What are variables?
  • Variables for numbers
  • Indexing number arrays
  • Variables for strings
  • Variables for logicals (Booleans)
  • Variables for structures
  • Variable naming rules and recommendations
Scripts and functions, part 1
  • Scripts and functions; organization
  • Function inputs and outputs
  • Getting help on functions
  • Comments, cells, spacing
  • Creating functions
  • The MATLAB path
  • Parameters and hard-coding vs. soft-coding
Getting data into and out of MATLAB
  • Copy-paste, loading MATLAB format files, Excel, and image files
  • Exporting data in MATLAB, text, and Excel formats
Control statements
  • Control statement architecture; if and switch commands
  • For-loops
  • While-loops
  • Try-catch statements
  • Application (1 of 2): import data
  • Application (2 of 2): export data
  • Exercise: Create a matrix of random integers
  • Exercise: Guess the number!
Visualizing data and functions
  • The importance of visualization; figure parts
  • Exercise: mo' subplots, mo' problems!
  • Plotting lines in 2D and in 3D
  • Making bar plots with error bars
  • imagesc, contourf, and surf
  • Improve your figure with get and set
  • Exercise: Find the fix the problems!
Functions, part 2
  • Miniverses; stepping into functions
  • Input checks on basicstats.m
  • Creating functions, example II
  • Creating functions: unique elements and frequencies
  • Anonymous functions
  • Exercise: anonymous function of two variables!
  • Set your preferences in startup.m and finish.m
Debugging
  • Types of programming difficulties, and tips for preventing errors
  • The FIP (find, inspect, plot) strategy for debugging
  • Examples of common programming errors
  • MATLAB profiler
Bonus section
  • Bonus lecture