Hello, I am trying to compile via the mcc matlab compiler a matlab script called main.m. This script calls a function called preprocessing.m which is located in an independent file in the same directory as the script main.m. The function uses SPM commands ( like Slice Timing , Co-register etc). The idea is to pass the scan to be processed to this preprocessing function and write the output to a directory. I would like to have a mcc compiled executable of main.m. However, the executables that I have built so far is unable to locate spm functions. I have tried following so far: mcc -m main.m preprocessing.m /path/to/spm12 -o test ./test This output is: Error in spm_select (line 110) Error in spm_select (line 105) Error in spm_select (line 92) Error in spm_jobman (line 171) Error in pre_processing_spm (line 9) Error in preproc_wrapper (line 17) Could you please tell me what is happening here? I appreciate your time. Thanks Usha