-
Obscure Matlab features #2: linear indexing, sub2ind, ind2sub
Matlab supports 3 forms of indexing matrices. There is the familiar range indexing that selects a submatrix within a larger matrix: This is also called sub-indexing. There is also logical indexing: These two methods are fairly expressive, yet there are a certain number of operations which are awkward or impossible to perform with these. Let’s
-
Converting Word 2007 equations into 2003 or MathType equations
I used the Word 2007 equation editor for a recent paper. I like the editor because it supports TeX-like commands. Unfortunately some journals do not support Word 2007 equations. PLoS Biology suggest saving down as Word 2003 and recreating the equations manually. Argh, that sounds like a terrible way to spend an afternoon. Thankfully, MathType
-
Nice set of color and brightness illusions
Via Cracking the Enigma: some really nice visual illusions from Discover. Top image: the faces of the top and bottom blocks are the same shade of gray.
-
An alternative method for spike-triggered covariance
Spike-triggered covariance (STC) is a method of estimating receptive fields with quadratic or more generally symmetric nonlinearities in stimulus space. The basis idea behind spike-triggered covariance is that the ensemble of stimuli which drive a cell has different statistical properties than the ensemble of all stimuli that are presented to a neuron. In particular if
-
Whiten a matrix: Matlab & Python code
Whitening a matrix is a useful preprocessing step in data analysis. The goal is to transform matrix X into matrix Y such that Y has identity covariance matrix. This is straightforward enough, but in case you are too lazy to write such a function here’s how you can do it in Matlab: You can read