It could be that the error is due to a matlab path issue according to some previous posts, and it is true I cannot find matlab with getmatlab command. I have trouble setting up MATLABPATH.
First, I can open matlab from terminal with commands matlab12 or matlab 13, I have 2 versions that I use for other applications, located at
/usr/local/MATLAB/R2012b and /usr/local/MATLAB/R2013a (the files matlab12 and matlab13 used to call matlab are in /usr/local/bin)
and I have a startup.m file in $HOME/matlab where the freesurfer matlab files are visible to matlab.
However, when I call env from terminal, matlabpath does not show up.
I must mention that the default shell was bash, and I changed it to .tcsh when installing FS, which works well, without issues