Using AFNI commands in Matlab

AFNI experts,

I know there is a package for Matlab interface.
However, what I want to do is to use “system” command in Matlab to directly use AFNI commands.
Currently, I thought I changed the default SHELL from bash to tshell.
However, Matlab did not recognize it.
I also checked to change Matlab environment setting in the link,

It also did not work.
When I type system(‘tcsh’) in Matlab command line.
Matlab command line changed into terminal, and I never come back to matlab command line again.

Would you help me out with this issue?

Sungshin Kim

Mostly, running shell commands in Matlab works fine, and little has to be specific for AFNI programs to work. Matlab uses the sh shell (neither bash nor tcsh, but the Bourne shell), and the configuration for that shell needs to be correct. You can either have Matlab use a different shell through environment variables like MATLAB_SHELL or add PATH and DYLD_LIBRARY_PATH to a .profile file in your home directory. On a Mac, you may also need to set DYLD_LIBRARY_PATH in the terminal or shell used to start MATLAB and launch from the command line rather than run it from a GUI launcher. Security protection implemented on the MacOS could be turned off too. See these links for some more info.,149775,149775