Efficient Matlab Programming

From NA-Wiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 08:20, 21 January 2008

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