Find us on GitHub

Teaching basic lab skills
for research computing


Linear algebra lies at the heart of most scientific computations, so developers have been building and tuning libraries to do vector and matrix operations for sixty years. These libraries are frequently also used to work on other block data, such as images and grids; as a result, they have a bewildering variety of features, but repay close study with concise, high-performance code.

  • Array libraries like those in MATLAB store data in rectangular blocks of uniform data type.
  • These libraries use a data-parallel programming model to apply one operation to many data elements.
  • You should (almost) never loop over the elements of a vector or matrix: let the library do it instead.
  • Use slicing to select and combine subsets of data.
  • And use library functions to do higher-level linear algebra operations rather than writing them yourself.
  1. Introduction
  2. Linear Algebra
  3. Basics
  4. Indexing
  5. Basic Flow Control
  6. More Flow Control
  7. Basic I/O
  8. More I/O
  9. Visualization
  10. Cell Arrays