help > Running NBS from script rather than GUI
Feb 23, 2026  06:02 PM | jtanne98
Running NBS from script rather than GUI

All, 

Apologies if this is obvious, but I have checked the documentation and forum but have not found a clear answer.

I would appreciate being able to run this using script in order to batch different analyses. This is the only one i can get to run, but still produces errors on the size of C not being 2D. 


If there is example script code to run a glm comparing two unpaired groups while adjusting for covariates, that would be very welcome. 


%% 
n_perm=1000;
age = %continuous but demeaned
sex   %coded 0 and 1
group = % 1 = Group, 0 = Control
X = [ones(size(group)) group  age sex ];


C1= [0  1 0 0]; % Group over Control
C2= [0  1 0 0]; % Control over Group



%%
global NBS
NBS=struct()
NBS.GLM.perms=n_perm;
NBS.GLM.X=X_w120;
NBS.GLM.y=C_w120;
NBS.GLM.contrast=C1;
NBS.GLM.test='ttest';



NBSglm(NBS.GLM)


NBS_1=NBS %stores NBS result 

Threaded View

TitleAuthorDate
Running NBS from script rather than GUI
jtanne98 Feb 23, 2026
jtanne98 Feb 26, 2026
Andrew Zalesky Feb 23, 2026
jtanne98 Feb 23, 2026
Andrew Zalesky Feb 24, 2026