Thanks for your answer, here is the contents of the “log file” :
Welcome to SARPROZ
by Daniele Perissin, copyright 2009-2021, http://www.sarproz.com
Messages from this session are written in file 17_Nov_2021_08_19_04_sarproz.log
directory /Users/sw/pcodes_2021-04-08
MATLAB 9.10 (R2021a) 14-Nov-2020
No errors are printed, just the SARPROZ freezing. I wonder whether this is because of Matlab version inconsistency or something else. It works properly when I run my script containing the “fig=main(…)” command on Matlab 2015b on Windows-10, while when I run it on Matlab2021a on Mac Pro 2019 – macOS Big Sur, it freezes.
Moreover, the reason to run it in a script is because we want to run it on a cluster without graphic interface.
Best