Can you please share a small example dataset?

Zip together some file that can allow us to reproduce exactly this error:

- A few data files that if placed in FilesA/FilesB produce this error (try with a small number of files)
- The channel file(s) associated with these data files

Thanks

Ok fine.

Where I send you a link for get the data ?

Thanks

Julien

Thank you for the example files.

I tested them on my computer and it works:

It looks like you work on MacOS, and I suspect that you haven't compiled the library. I made the instructions more explicit in the tutorial:

https://neuroimage.usc.edu/brainstorm/Tutorials/Decoding#Download_and_installation

I added a test to make the error message more explicit than what you got:

process_decoding_svm: New error message when libsvm must be compiled · brainstorm-tools/brainstorm3@aab5862 · GitHub

Perfect, you were fully right ! After having compiled the library, I had a nice result decoding result.

Thanks a lot for your help and this very nice process.

Last question : is there a significant value for decoding accuracy ? 80 - 90 %? I guess this is user's "choice" ?

Best

Hi Jungju,

To establish statistical significance in decoding results, you still need to do statistics because high classification values can still arise by chance. See for example https://www.sciencedirect.com/science/article/pii/S0165027015000114

I use permutation tests in my work, when having multiple subjects and each subject contributes one decoding time course.

Best,

Dimitrios

Hi Francois,

I got exactly the same error as here while trying with the tutorial example dataset on Brainstorm. I have compiled the library but it's still not working. It might be due to the built-in function of MATLAB itself?

)

Thank you.

Tracy

Hi @popotracy,

Did you already update your Matlab path to have the path to the compiled `libsvm`

library in a higher position, so this is the one `svmtrain`

that is called, rather than Matlab one?

Thanks for your reply. I tested it by doing "exist svmtrain" and 'which svmtrain' in my command windows, MATLAB told me it is from my LIBSVM library and a MEX-file on my MATLAB search path, so I assume I am running the correct one, but I still get the same error.

Thank you again for your time.

Tracy

Do you get any addition information in Matlab's command window?

With Brainstorm running, execute this command in Matlab and paste the response:

`bst_get('OsType')`

Hi Raymundo,

Sorry for the late reply. It gave me "mac64" from the command. Please see the other message from MATLAB while I ran the SVM decoding in Brainstorm. Thank you for your time!

Hi Tracy,

The `mac64`

indicates that you are running on macOS (of course) with an Intel processor.

I tested on the same setup, and I got the same error as you (hurray!), and now it's solved.

I'm using Matlab 2020b, with macOS 14.4.1 and Xcode 15.3

Please follow the steps below to determine if it is indeed the same problem, if it is, the solution will be after the steps:

In Brainstorm, start with a clean

- Uninstall the plugin
**libsvm** - Clear the Matlab command window with
`clc`

- Install the plugin
**libsvm**, the installation should perform the compiling of the library - Check if there are any errors in the command window
- There should be 4
`.mex`

files at`/Users/USERNAME/.brainstorm/plugins/`

- Start Brainstorm and load the
**libsvm**plugin - Open the file
`sll_devodesvm.m`

it is in`brainstorm3/external/scilearnlab`

- Between lines 34 and 44, comment everything. Except line 36, so all that block just reads:

```
svmtrain([0 1],[0 1],'-s 0 -t 0 -q'); %this should not produce errors in libsvm is installed
```

- Try to do the decoding again.
- It should give you a long and detailed error message. Please pasted in here.

**Solution**. In my case the error indicated that ** Library not loaded: @rpath/libMatlabEngine** and all the places where it tried to find it. So I created a symbolic link (need to be done as admin) to one of the expected places:

```
ln -s /Applications/MATLAB_R2020b.app/extern/bin/maci64/libMatlabEngine.dylib /Applications/MATLAB_R2020b.app/bin/maci64/libMatlabEngine.dylib
```

Which Matlab version are you using?