ReHo: quickly get the ranks for matrix

Hi, Xiao-Wei

I just write these here and suggest you use methods below to get the ranks more quickly:
(here I suppose symbol V means a 4D fMRI matrix)
%-----------------------------------------------
[Y,I]=sort(V,4);
[X,R]=sort(I,4);
%-----------------------------------------------
R should be the ranks 4D matrix, which can be used for ReHo computation. These two lines code make computation faster in MATLAB (around 10s for one 4D fMRI data).

Say hi to your guys
XINIAN

Forums: