Invalid MEX-file

Hi all,

I'm facing a problem when I try to run the function ft_freqstatistics (Fieldtrip).
This is the error:

Error: [process_ft_freqstatistics] Test > FieldTrip: ft_freqstatistics
** Line 107: Invalid MEX-file 'C:\Program Files\brainstorm_200203\brainstorm3\external\fieldtrip-20161013\private\combineClusters.mexw64': the specified module could not be found.

Same problem when I tried with other Fieldtrip versions (fieldtrip-20170824; fieldtrip-20200315; fieldtrip-20190109).

How could I fix it?


fieldtrip-20161013, Matlab R2019b, Windows 10 v1903 (OS Builds 18362.720)

First thing: avoid adding anything to the brainstorm3 folder. Install FieldTrip somewhere else.
Make sure you don't have multiple versions of FieldTrip in your Matlab path.
Always try to work with recent versions of both Brainstorm and FieldTrip (delete or archive the 2016-2019 version)

In Matlab, go in the folder fieldtrip-20200315/private, and type combineClusters in the Matlab command window. You should get this error:

>> combineClusters
Error using combineClusters
three inputs required: labelmat, neighbours, total

If you don't, there is some problem with your FieldTrip installation or there are some shared libraries missing in your system to load this mex file. This is a FieldTrip question, I don't have the source code or compilation instructions for this mex file, so I don't know how to help you further.

  • Open a new issue on the FieldTrip github repository:
  • Include the output of the "ver" command, typed in the Matlab command window.
  • Post the link to the new FieldTrip issue on this forum, so I can follow it now and for future reference