A problem (and maybe a solution) with bst_registerstudies

Hello,

I was attempting to run bst_registerstudies on the mode “target a commonChannel structure defined by the user”, (vs. create the average of channels in all datasets) but it was not so good, cause a variable used bellow was not defined in this mode.

I add at line 142 this pretty formula :
channelSelect=mat2cell(repmat([1:length(targetChannel)],1,length(dataSets)),1,repmat(length(targetChannel),1,length(dataSets)));
which is meant to reconstruct the variable as it should be (I think)

And now it works :wink:
(well it works so far, and it works for me)
the only hint is that we assume that all channels that are given as ‘commonChannel’ are selected for the averaging

Hope it will help,

Vincent

Thanks Vincent. That’s excellent!

I’m including your contribution to the next nightly package.