Run matlab command for beginners

I’m a musician, not a computer programmer. I surmise that using the preprocessing > run matlab command is probably easy… but only if you understand the language that is being used.

Specifically, I would like to export an epoched time-series data file using the out_fieldtrip_data function in the Brainstorm toolbox, as I have read that this then can be used in SPM. But I don’t understand what to actually input to make the function run correctly.

I checked the tutorials, and the forum thoroughly, but it the information available seems to be for people that already understand the basics. I just want to run that one function for now. I’m sure there are many people that could answer this question. I really appreciate any advice and assistance Francois or the larger community can offer. (Note, I am running Brainstorm from Matlab)

Thank you,

Jared

Hi Jared,

You will not be able to call out_fieldtrip_data from the process “Run Matlab command”. This process passes only the data matrix to the script, not all the file structure. The function out_fieldtrip_data needs all the metadata associated with the data.

To export a file as a FieldTrip structure, right-click on it > File > Export to file > Select the file format “MEG/EEG: FieldTrip timelock”.

If you want to run this from a script (which you probably won’t if you don’t want to write any piece of Matlab code), you can call the function export_data.m. To get the list of files from a script, you can use either database calls (http://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Database_requests) or the selection processes in menu “File”.

Cheers,
Francois