Script to export to file

Hello,

I am writing a script that automatically goes through my database and runs a set of analyses and then saves the results with a certain name.

To further process the result I am looking to export the .mat result with "export to file" to a different location with a specific new name for the m-file.

However, I was not able to figure out how to do this.

After I run bst_report on my results, how can I export and rename the resulting m-file?

Thanks in advance!

To further process the result I am looking to export the .mat result with "export to file" to a different location with a specific new name for the m-file.
how can I export and rename the resulting m-file?

With "m-file", I assume you designate the .mat file containing the data, not the .m file containing the script.

  • The menu "Export to file" calls different functions depending on the type of file that is selected. To see which one, open the file tree_callbacks.m and search for the text "Export to file".
  • These functions are listed in the Scripting tutorial, open the export_...m function you need to use and read the instructions in the file header: https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Reference:_File_manipulation
  • If you want to keep the file in .mat format, you don't have anything to do: just read it with the Brainstorm reading functions (see Scripting tutorial) or with the Matlab load function.
  • If you want to move the files to a different place of the Brainstorm database, use the dedicated process in the File process menu. Never move around files manually.
  • If you export files with any of the export_*.m functions: do not store the output inside any of the Brainstorm folder (outside of brainstorm_db, brainstorm3 and .brainstorm)

Yes your assumption is correct, sorry for the typo. Thank you so much, I will check out those resources.