Paired ttest: too many input arguments

Dear group,

any idea why the ttest is not working correctly?
The previous ttest-version (DECARTED) worked quite well but with the last update the version was replaced completely and the new version seems to generate the bug (it doesn't matter if you use magnitude or5 any other data).


Best, John

Hi John,

I’m sorry for this new issue. This new process will replace the old t-test, so I would prefer to fix this error rather than reintegrating the old function.
Can you please detail the type of files on which you are running the test?
Can you please add two screen captures: one showing at least one of the files you test in the database explorer, and one showing the options you selected for this process?
I’ll try to fix this as soon as possible.

In the meantime, you can get access to the old function by simply moving the files process_ttest.m process_ttest_paired.m
from: brainstorm3/toolbox/process/deprecated
to: brainstorm3/toolbox/process/functions

Thanks,
Francois

hi…
the error is this

n = repmat(StatA.nGoodSamples(isGood,:,:), 1, size(mean_diff,2), size(mean_diff,3));

this

n = repmat(StatA.nGoodSamples(isGood,:,:), [1, size(mean_diff,2), size(mean_diff,3)]);

solves it …but I don’t know if this is the intended behaviour…

regards
Alberto

Hi Alberto,

The two calls are supposed to be strictly equivalent, see the reference documentation:
https://www.mathworks.com/help/matlab/ref/repmat.html

If the two lines you mentioned give different results, this corresponds to a Matlab bug…
What version of Matlab are you using?

Same questions I asked John:
Can you please detail the type of files on which you are running the test?
Can you please add two screen captures: one showing at least one of the files you test in the database explorer, and one showing the options you selected for this process?

Thanks,
Francois

hi francois

I use the 2012 version…where

B = repmat(A,m,n)
B = repmat(A,[m n])
B = repmat(A,[m n p…])

is the only allowed sintax…
so that’s the reason for my error, and possibly for john’s one.
if the B = repmat(A,[m n p…]) version also work for last matlab versions, maybe you could move back to increase the back-compatibility of your code,otherwise older version’s user will fork their local code.
thanks for your answer
cheers
Alberto

@Alberto: Good catch! I fixed the code.
Thank you very much for the fix!

@John: Please update Brainstorm (menu Help > Update Brainstorm) and try again.

Dear Alberto, dear Francois,
thank you very much - it’ working brillant again :slight_smile:
Best, John