<p>Try inserting the lines:</p>

<pre><code>which marmoire
pause
</code></pre>

<p>into marsbar just before Line 125.</p>

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

CC BY-SA 3.0
2016-01-05T23:17:27.023Z
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.
lf_araujo
CC BY-SA 3.0
2016-01-06T16:27:00.253Z
Matlab shouldn't give an error if 'which' does not find anything. The message would have been: `'marmoire' not found.`
K A
CC BY-SA 3.0
2016-01-06T16:34:08.603Z
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
CC BY-SA 3.0
2016-01-05T16:43:54.607Z
2016-01-05T16:43:54.607Z
K A
<p>Thanks for the comments, @serk1. The answer to this question is that that is a bug, it seems.</p>

<p>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. </p>

<p>I will leave the question here, in case someone run into similar problems.</p>

CC BY-SA 3.0
2016-01-07T00:44:26.040Z
2016-06-06T23:23:58.387Z
2016-06-06T23:23:58.387Z
lf_araujo
<p>I am trying to install <a href="http://marsbar.sourceforge.net/download.html#" rel="nofollow noreferrer">MARSBAR</a> toolbox into <a href="http://www.fil.ion.ucl.ac.uk/spm/software/spm12/" rel="nofollow noreferrer">SPM12</a>, 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 <a href="https://au.mathworks.com/products/matlab/" rel="nofollow noreferrer">matlab</a> wouldn't find the script files (extension .m). I added them manually to the path, and that worked out.</p>

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

<pre><code>&gt;&gt; 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');
</code></pre>

<p>Even though the function marmoire that it is complaining about IS on the path and with proper permissions! <strong>&lt;- Actually not, see below.</strong></p>

<p>Googling the error took me to a lot of different complaints from users that had difficulties about running it on SPM12 <a href="http://blog.gmane.org/gmane.comp.graphics.spm.marsbar/month=20060301" rel="nofollow noreferrer">1</a> <a href="http://marsbar-users.narkive.com/YFbLYFhJ/no-subject" rel="nofollow noreferrer">2</a>, however none were quite the same as the problem I've been facing.</p>

<p>Also, the <a href="http://marsbar.sourceforge.net/marsbar.pdf" rel="nofollow noreferrer">documentation</a> for the toolbox is quite outdated now, it seems.</p>

<p>Any light here would be greatly appreciated!</p>

<p><strong>UPDATE 6.1.16</strong>
As per suggestion in the comments I added two lines before marsbar calls marmoire.</p>

<p><a href="https://i.sstatic.net/gHvYF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gHvYF.png" alt="enter image description here"></a></p>

<p>Now the error is:</p>

<pre><code>&gt;&gt; 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');
</code></pre>

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

<p><a href="https://i.sstatic.net/i9jZv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/i9jZv.png" alt="enter image description here"></a></p>

<p>And the problem persists.</p>

CC BY-SA 3.0
2016-06-06T15:12:58.843Z
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. :)
Louis Thibault
CC BY-SA 3.0
2016-06-06T23:23:38.247Z
Couldn't agree more @blz. I hope someonen picks this project and maintain it with R, far more sane framework.
lf_araujo
CC BY-SA 3.0
2016-06-07T12:17:18.813Z
@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:  http://nipy.org/
Louis Thibault
<neuroimaging><spm>
How to install MARSBAR toolbox in SPM12?
lf_araujo
# How to install MARSBAR toolbox in SPM12?

(Asked by: username_0 on 2016-01-05)

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.

**Tags:** neuroimaging, spm

> **Comments:**
> **username_1**: 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. :)  
> **username_0**: Couldn't agree more @blz. I hope someonen picks this project and maintain it with R, far more sane framework.  
> **username_1**: @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:  http://nipy.org/  

---

## 2 answers

### Answer by username_0 on 2016-01-07. Score: 2 | Accepted answer

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.


---

### Answer by username_2 on 2016-01-05. Score: 0

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.

> **Comments:**
> **username_0**: 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.  
> **username_2**: Matlab shouldn't give an error if 'which' does not find anything. The message would have been: `'marmoire' not found.`  
> **username_2**: 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.  

---

