Hello,
I will refrain from commenting on Matlab, but it looks like you don't have AFNI in your PATH (in bash), and so the attempted 3dcalc command (to generate an empty dataset) did not work.
Can you run AFNI programs from the shell? For example, what is the output (from a terminal prompt) of:
afni_system_check.py -check_all
- rick