Problem opening .mat file of MEG file and converting to FIF

First of all, a .mat file is not a file format for MEG data, it is a generic contained with an unrestricted list of variables. There is no way for any program to guess what is it.
If you file is a SPM or EEGLAB file structure, read it with the correct file format selected instead of the the generic ".mat" entry.

If your .mat file contains only the sensor signals saved as a 2D matrix, it should not be used to import MEG recordings into the Brainstorm database. There are lots of extra information that are needed to process this data correctly in the original files (sensors positions, types, properties, calibration of the references, etc). There is no easy solution for doing is in Brainstorm, because it should not be done this way. I recommend you import the original MEG recordings in Brainstorm instead.

If you still want to do this, you need to do everything manually, and probably get some proper training with Brainstorm data structures and scripting before: https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

  • You would import you data as EEG
  • You need to edit the channel file and change the types of the sensors to MEG
  • You can't enter the positions/orientations of the sensors and therefore won't be able to perform any source localization, or to display 2D/3D topo plots
  • The only thing you'd be able to do is to display the signals, and run some processes on them (e.g. averaging them). You can already do this in Matlab, you don't need Brainstorm for that.

we are thinking of solutions : for exemple to copy the matrix element from the .mat file and paste it in a .fif m file , is this possible ? how we can open an .fif file ?

FIF is a complicated file format. I don't recommend you try in this direction if you are not an expert in this field.