Hi, Andrew-
Caveat: I don't use Matlab, so don't have a deep answer here---maybe not even a helpful one, it might be best classified as "thinking out loud".
I just tested running Matlab on our HPC cluster here, and running:
unix(['1d_tool.py -help'])
It worked successfully for me, so the issue doesn't seem to be inherent to the program file.
My understanding is that the return code of 127 means that the system cannot find that command. You noted that in a zsh terminal, you can run "1d_tool.py" and see the program help. But I wonder if your Matlab is using a different shell, one that doesn't have the AFNI binaries directory added to its path, perhaps (or, from that specific message, perhaps not even python)?
What is the output of each of the following for you:
A) to see what shell Matlab is using
unix(['echo $0'])
B) to see which python is there/available
unix(['which python'])
C) to see what version of python that is
unix(['python -V'])
D) the shebang of the Python programs in AFNI uses '/usr/bin/env ..', which in some system configurations can be different that the standard 'python' (because people set up aliases or other things):
unix(['/usr/bin/env python -V'])
--pt