Yes, you can run FSL from Matlab. Here is how – two step process for me (but it could be more efficient, if need be):
(a) First, launch Matlab (assuming on a Mac) from a terminal that is already setup for FSL (see here for more info)
/Applications/<matlab_folder>/bin/matlab &
(b) Second, at the beginning of your Matlab script, add the following lines of code. This way Matlab knows where does FSL exist,
% set FSL environment
setenv(‘FSLDIR’,'/usr/local/fsl’); % this to tell where FSL folder is
setenv(‘FSLOUTPUTTYPE’, ‘NIFTI_GZ’); % this to tell what the output type would be
That’s it and you can launch any FSL command as follows,
cmd = ‘/usr/local/fsl/bin/feat design.fsf’;
system(cmd);
Hope that helps!
That’s a very neat little trick! Thanks.