How to run .m script using spm standalone with mcr? any example?

Hi, Are you there? My script was working properly now I have changes the Linux machine running the same script in the same environment and it’s showing errors like

Error using spm (line 1139)
Error: Function definition not supported in this context. Create functions in code file.
Error in spm (line 1139)
Error in spm_standalone (line 115)

Hi,
This error is because you have a function keyword in your script which will not work with the standalone ver of spm. Either compile this script or remove the function word.

Cheers

Hi,
What is the correct syntax for invoking the SPM standalone with a Matlab executable? I only see the syntax for doing it with a non-compiled script:

./run_spm12.sh <MCR path> script spm_script.m