See the Process in Matlab

Hello There,
Is there any way to see the process through the Matlab step by step.
Meaning that I can see for each task what happens in Matlab.
My goal is to perform the process using BrainStorm but also have it as Matlab Code too. So if I wanted to do some innovation like putting any process in the loop or enhancing any process I can.

Again, thank you for your all help.
This is definitely the best and the most useful discussion board I have ever seen

Best Regards
Younes

Hi Younes,

Refer to the Scripting tutorial page for information on how to call Brainstorm processes from your own Matlab scripts. You can make your own loops from there, and add breakpoints in Matlab to go through the process step by step.

I hope this helps,
Martin

1 Like

Additionally, if you are interested in following the execution of the Matlab code step by step, you should learn how to use the Matlab debugger. Watch an online tutorial, then place breakpoints in the code (click on the line you want to explore from) and then execute the code line by line, explore the content of the variables, etc.

The difficult part is to know from which function to start from. If you click on a button or a menu that has a label, search the Brainstorm code for the corresponding string (Shift+Ctrl+F, search subfolders), place a breakpoint at the beginning of the callback function associated to this button, then click on the button. The debugger should stop at the beginning of the callback.

1 Like

Thank you so much for the information.
I am following your guidelines, Right now I am trying to figure out where the variables are saved.
Based on image bellow, I am assuming that sFilesRaw should contain the raw EEG data, But i cant figure out where they are saved as there is no variable in the structure

This variable sFilesRaw contains only the reference to the data file in the database.
The data itself is saved in the file sFilesRaw.FileName. You can load this with function in_bst_data.m, or simply with the Matlab function load(), with function file_fullpath.m to get the full path to the file.

1 Like