matlab

saveppt2, save MatLab figures to PowerPoint

I find saveppt2 is very useful in data exploration. I often have to view a lot of plots/figures for individual subjects during quality checking or data exploration. It would be ideal to have a script to automatically save the plots into PowerPoint an
Xu Cui
17 sec read

Winner take all in SVM?

updated: 2010/01/05, add plot of original data Assume our data contains two features and they are highly correlated (say, r>0.9). The 1st feature does slightly better than the 2nd one in classifying the data. The question is, is the weight of the
Xu Cui
1 min read

MatLab and Excel

I usually write MatLab scripts to parse the behavior data collected in a fMRI or NIRS experiment. It’s powerful and flexible. But as I have to do an Excel version recently, I found Excel has a great advantage — it’s easy to share wi
Xu Cui
21 sec read

SVM (support vector machine) with libsvm

I am learning svm lately and tried libsvm. It’s a good package. Linear kernel example (support vectors are in circles): Nonlinear example (radial basis) 3-class example Basic procedure to use libsvm: Preprocess your data. This including normali
Xu Cui
1 min read

Sensitivity, specificity, ROC, AUC …

You can’t believe how much jargon there is in binary classification. Just remember the following diagram (from wiki). accuracy = ( TP + TN ) / (P+N), i.e. correctly classified divided by the total false discovery rate (FDR) = TP / (TP+FP), i.e.
Xu Cui
1 min read

NIRS data analysis (time series)

Also check out NIRS data analysis (GLM and visualization) Environment requirement MatLab SPM xTopo under xjView xjview is located in /fs/fmrihome/fMRItools/Xjview Add xjview to path by addpath(genpath('/fs/fmrihome/fMRItool
Xu Cui
1 min read

NIRS data analysis (GLM and visualization)

Also check out NIRS data analysis (time series) Environment requirement MatLab SPM 5 or 8 xjView 8 xjview can be downloaded for free from https://www.alivelearn.net/xjview/ (If you are inside CIBSR, xjview  is located in /f
Xu Cui
3 min read

Tips for writing faster MatLab programs

Avoid using explicit loop if possible %calculating the sum of the product of corresponding element in two row vectors A and B %bad example s = 0; for i=1:100 s = s + A(i)*B(i); end %good example s = A*B'; Avoid increment memory allocation, inste
Xu Cui
16 sec read

AdaBoost, Adaptive boosting

AdaBoost is an algorithm to linearly combine many classifiers and form a much better classifier. It has been widely used in computer vision (e.g. identify faces in a picture or movie). Look at the following example: How it works? First, you have a tr
Xu Cui
51 sec read