# How to install MARSBAR toolbox in SPM12?

I am trying to install MARSBAR toolbox into SPM12, but I am running into different problems. Initially they were all related to directory ownership and permissions (using Ubuntu 14.04), which I managed to correct, but then matlab wouldn't find the script files (extension .m). I added them manually to the path, and that worked out.

Finally, and here is the point I can't go through, when I run marsbar in MATLAB I keep running into:

>> marsbar
MarsBaR analysis functions prepended to path
Undefined function or variable 'marmoire'.

Error in marsbar (line 125)
o = marmoire;

Error in marsbar (line 57)
marsbar('on');


Even though the function marmoire that it is complaining about IS on the path and with proper permissions! <- Actually not, see below.

Googling the error took me to a lot of different complaints from users that had difficulties about running it on SPM12 1 2, however none were quite the same as the problem I've been facing.

Also, the documentation for the toolbox is quite outdated now, it seems.

Any light here would be greatly appreciated!

UPDATE 6.1.16 As per suggestion in the comments I added two lines before marsbar calls marmoire.

Now the error is:

>> marsbar
MarsBaR analysis functions prepended to path
Undefined function or variable 'marmoire'.

Error in marsbar (line 125)
which marmoire

Error in marsbar (line 57)
marsbar('on');


Which means that marmoire is not actually in the proper path, however I copied it to the same directory as marsbar:

And the problem persists.

• Tangentially-related, but might save someone else from a headache: spm12 (for me) is not starteable via the SPM GUI. Instead, I have to type marsbar in the Matlab prompt and then it works without a hickup. Stay strong, friends -- SPM is an awful tool, but it can and does work after you've pulled all your hair out. :) Jun 6 '16 at 15:12
• Couldn't agree more @blz. I hope someonen picks this project and maintain it with R, far more sane framework. Jun 6 '16 at 23:23
• @Luiís May I suggest nipy as a saner alternative? I'm in the process of making the switch and I'm quite impressed so far: nipy.org Jun 7 '16 at 12:17

Thanks for the comments, @serk1. The answer to this question is that that is a bug, it seems.

I gave up editing the scripts myself and decided to reinstall Matlab and Marsbar, and it properly recognized the path and the permission for the files after that.

I will leave the question here, in case someone run into similar problems.

Try inserting the lines:

which marmoire
pause


into marsbar just before Line 125.

This would help you verify for sure that marmoire is on the path when that line is being called.

• Well, it confirmed that somehow matlab is not picking the file properly. However, it is still not solved. I updated the question to reflect your suggestion. Please, have a look. Jan 5 '16 at 23:17
• Matlab shouldn't give an error if 'which' does not find anything. The message would have been: 'marmoire' not found.
– K A
Jan 6 '16 at 16:27
• I don't think that marmoire is the problem. There is something going on with the code before it and Matlab is sending an error that doesn't make sense. I'd guess that you could put the line a = 1; just before which marmoire and you would see an error for that instead.
– K A
Jan 6 '16 at 16:34