Changes in brainstorm functions that doesn't work when scripting

Thank you for your answer, I didn't think about using matlab debugger.

In fact we found the issue. It was because we didn't reload the database at each iteration of our for loop. For memory issue I was deleting some files at the end of each iteration. The code when running wasn't showing any error but no window showing the process opened. So I think that because of the mismatch between the files that really exist and those that Brainstorm consider in its database, the program wasn't running well.