Category: Matlab
-
Send a text message or email when a Matlab script is finished
It’s a drag to periodically check Matlab to see if a long-running script has finished. Why not go read some papers at the library and wait for Matlab to call you: “Yo, it’s Matlab. Your script’s done. […] Yeah I’ll pick up some milk. Love you.”. Well I haven’t figured out a way for Matlab…
-
Using an L1 penalty with an arbitrary error function
The L1 penalty, which corresponds to a Laplacian prior, encourages model parameters to be sparse. There’s plenty of solvers for the L1 penalized least-squares problem, . It’s harder to find methods for other error functions than the sum-of-squares. L1General by Mark Schmidt solves just such a problem. There’s more than a dozen different algorithms implemented…
-
Poor man’s parallel computing on multiple computers in Matlab
Let’s say that you need to run the same analysis with multiple datasets; for instance, you need to do reverse correlation with multiple cells. This might take a while, so you would like to run the analysis on multiple computers. The computers might be a bit different from each other, as well as the recording…
-
Extracting data from published graphs in Matlab
Have you ever needed to grab data from a published graph, perhaps to reanalyze the results? The grabit function, available on Matlab Central, does exactly this. It’s a GUI that allows the user to specify the location of axes, and then grab data by clicking on the data points. Learned about it in the Methods…
-
Lecture notes on EEG/LFP analysis
I was looking for some Matlab code for computing phase-locking histograms from LFPs and I stumbled upon these lecture notes for a psychology class at University of Arizona by John J.B. Allen. The Advanced Signal Processing class covers different approaches for computing inter-trial and inter-electrode phase locking. There’s some lecture slides, matlab code, and even…