matlab

Brain surface template

Sometimes we need to work on the surface of a brain. Here I create a surface mask based on the standard avg152T1 image (MNI...
Xu Cui
21 sec read

Handy programs to visualize NIRS data (6): plotAverage

This is the 6th post of the series: Handy programs to visualize NIRS data When we do an experiment, we often repeat an event (or...
Xu Cui
55 sec read

Extracting wavelet coherence values

In my previous blog (https://www.alivelearn.net/?p=1426) and in our paper titled “NIRS-based hyperscanning reveals increased interpersonal coherence in superior frontal cortex during cooperation” (full text...
Xu Cui
24 sec read

MatLab tip: format shortg

The default format of output in MatLab is like below: v = 1.0e+003 * 9.0579 1.2699 9.1338 6.3236 0.9754 What if you want the...
Xu Cui
7 sec read

ANOVA with MatLab

The statistics toolbox in MatLab provides an easy way to do 1-way and 2-way anova. Below are some examples. The functions are called anova1...
Xu Cui
1 min read

SVM regression (SVR) vs Linear Regression

One particular nice thing about SVR is that the weight of each feature reflects the feature’s true contribution. If some features are highly correlated...
Xu Cui
1 min read

Convert coordinates in MNI space to matrix space

Quite often you need to convert the coordinates of some voxels in MNI space to regular matrix coordinates. Below is a script to do...
Xu Cui
43 sec read

Using environment variables in MatLab

Quite often you need to call external or system commands inside MatLab. Sometimes that external commands requires setting up environment variables in the shell....
Xu Cui
14 sec read

Small MatLab tips

genpath When you add a folder to path, you often want to add all its subfolders (and their subfolders) to path too. In this...
Xu Cui
1 min read

What does a wavelet transform plot tell you?

Let’s say you collected some brain data (time series) using NIRS while the participants were performing a task (say finger tapping), and you use...
Xu Cui
1 min read