Efficient Matlab Programming

From NA-Wiki

Revision as of 08:35, 21 January 2008 by Dag (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here are some notes on how to write good and efficient Matlab code. It covers:

  • Pre-allocation of memory
  • Inline and anonymous functions
  • Vectorization via element sub-scripting
  • Vectorization via logical index masking
  • The benefit of JIT
  • Direct and "indirect" indexing
  • Copy-on-write
  • Construction of sparse matrices
Personal tools