SIO 209 Introduction to MATLAB (section 885763), Fall 2016 (1 unit S/U)

syllabus & course information

Instructor: Sarah Giddings, sarahgid at
Class times: Sept 19 – Sept 20, every day, 9am-12pm (with a break!), Sept 21 8am-10am
Location: Nierenberg Hall 101
Office hours: every day 12-2pm, MESOM 365, or email me to set up an appointment

course summary:

This course will provide a hands-on introduction to MATLAB. No prior experience is necessary. The course will cover variables, plotting, scripts, matrices and other ways to store data including NetCDF, loops, and an introduction to more advanced techniques. Course material including notes, homework, and .mat files will be posted here as the course progresses.

course schedule and links to materials:

tentative! Links will be provided when the class starts

* Monday September 19th

Workspace, startup, basic math, matrices & arrays, element-by-element vs. matrix math, symbolic algebra, scripts, best practices, basic plotting, saving figures, saving & loading data, loading and saving .txt or ascii files

* Tuesday September 20th

Basic statistics, basic fitting, MATLAB dates, indexing, 2D plotting, other figure properties, get and set, characters & strings, mapping

* Wednesday September 21st

Functions, if statements, for & while loops, vectorizing code for efficiency, structures, cell arrays, Native MATLAB NetCDF, SNCtools NetCDF


You do not need any background with Matlab or computer programming. In order to follow along and do the homework, you will need to have access to a computer that runs Matlab. UCSD now has campus-wide MATLAB licence, instructions for students are here. Another option is to try the virtual lab. Worst case scenario, buy a copy of the student version at the UCSD bookstore ($100). It is highly encouraged that you bring a laptop to class so that you can follow along. Code is learned best by practice.

credit & homework:

To get course credit, you must attend all 3 days of class and complete the daily homework. Homework will not be graded, it will be self-check. Again, you learn code best by doing!


There are many textbooks covering Matlab, so you might check out the selection at the UCSD bookstore. Here are a couple of suggestions:

  • Matlab, Third Edition: A Practical Introduction to Programming and Problem Solving, by Stormy Attaway (bookstore link) (Amazon link). This one is well reviewed and recent.
  • Physical Oceanography: A Mathematical Introduction with MATLAB, by Reza Malek-Madani (bookstore link) (Amazon link). This book seems useful for those interested in using Matlab to solve numerical problems in physical oceanography. For those of you in different fields, look on-line, there are great books for applications to engineering, numerical methods, biology, etc.

Online tutorials:

  • Mathworks (the company who developed Matlab) has an online tutorial as well as a detailed users manual is available.
  • Regular Google searches work pretty well too as there is a very large user community and on-line responses to questions as well as application specific code sharing. Some code you will find through individual websites (e.g., TEOS-10) others you can find on the Matlab code file exchange.

Matlab help files (online and offline)

All of the Matlab help files are available within the program and online help. For functions,  (e.g. the “plot” function), you can use the help command: >>help plot OR >>doc plot.