matlab

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

Handy programs to visualize NIRS data (5): plot2

Let’s say you have two correlated variables, x and y. You may have more then one data points with x=10 and y=5. But if...
Xu Cui
31 sec read

Handy programs to visualize NIRS data (4): wt

In case you need to visualize your time series in both time and frequency domain (or just frequency domain), you can use the wt...
Xu Cui
33 sec read

Handy programs to visualize NIRS data (3): plotFFT

Sometimes you wish to know the spectrum of a time series. plotFFT is a handy function for this purpose. You instantly know the power...
Xu Cui
11 sec read

Handy programs to visualize NIRS data (1): plotTraces

You often need to plot the time series of NIRS signal from all channels with event indicators (See the example below). plotTraces can do...
Xu Cui
26 sec read

MatLab set environment path

Quite often you need to call external or system commands inside MatLab. If those external commands are not in path, you need to add...
Xu Cui
7 sec read

Converting DICOM files to Analyze file in batch mode

I use SPM’s dicom import function to convert DICOM files to Analyze files. But it’s quite inconvenient if I have 20 subjects. Below is...
Xu Cui
23 sec read

Realtime feedback from NIRS recording

Hitachi provides a Matlab script (RealtimeOT.m) which can deliver real-time feedback from ETG-4000. This script is installed in the computer (Windows 2000) in the...
Xu Cui
2 min read

Using serial port to control ETG4000

To synchronize NIRS recording and your stimuli (visual, auditory, button press etc), your presentation program needs to talk to the NIRS machine. Hitachi ETG4000...
Xu Cui
2 min read