Code I've written that may be useful. Let me know if you find a bug. Don't blame me if your computer catches on fire.

Individual files:

FindWindowedPeaks.m: Extract peaks from a time series given a desired minimum gap between peaks.

ptr.m: A pointer in Matlab! If p = ptr() and you've set p.d.fld = 'hi', then dereference it like this: p.d.fld. Think of ".d." as the C language's "->" operator.

mop.m: Perform (A op B) where one of A or B is a vector instead of a matrix that needs to be repmat'ed to conform. On the command line, this gets tiresome; mop figures out what needs to be done and does it.

SaveStreamData.m: Functions to save a stream of data to a file. The data should be column oriented, so that one is building a wide matrix by appending columns. The purpose of this file is to provide an efficient implementation of a common I/O model in Matlab: save a stream of data as a simulation proceeds. For example, this routine could be used in the OutputFcn for ode* when solving a large problem.

GetMyCode.m: It's useful to save the code associated with data along with the data in a mat file. That way, in the future, you know exactly what version of the code created the data. Use this routine to do that.

SlashUnderscore.m: Place a backslash before underscores in a (cell array of) string(s) before plotting.

FdApprox.m: Calculate the coefficients in an approximation to the dth derivative for a uniformly spaced grid.

ssbin.m: Matrix-free approximate equilibration for a symmetric matrix.

snbin.m: Matrix-free approximate equilibration for a nonsymmetric matrix.

dsbin.m: Livne and Golub's algorithm for the equilibration of a symmetric matrix.

dsbin_mex.c: Livne and Golub's algorithm for the equilibration of a symmetric matrix. Mex implementation.