fahrenfort / ADAM

the Amsterdam Decoding And Modeling (ADAM) toolbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error running adam_detrend_and_epoch

romquentin opened this issue · comments

Hello,

I am trying to run adam_detrend_and_epoch (Matlab R2018b, ADAM 1.13 and EEGLAB2021.0) on MEG data.

The function stops with this error:

[Undefined function or variable 'topcs'.

Error in nt_regw (line 78)
            if nargout>1; z(:,iChan)=x*(topcs*b(iChan,1:size(topcs,2))') + mn(:,iChan); end

Error in nt_detrend (line 87)
    [~,y]=nt_regw(x,r,w);

Error in detrend_and_epoch (line 236)
        [~, w2,~,regressline2] = nt_detrend(tmp,polynomial_order,w1); % then nth order with mask of previous
        step

Error in adam_detrend_and_epoch (line 148)
        detrend_and_epoch(datadir,filenames{cSubj},outputdir, start_epoch, end_epoch, polynomial_order,
        pad_length, start_mask, end_mask, mask_only_current, mask_bad_data, channelpool, remove_bad_chans,
        event_codes);

Error in script (line 23)
adam_detrend_and_epoch(cfg);](url)

Also, I have this warning several times before the function stops.

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =  1.030416e-07. 
> In nt_regw (line 76)
  In nt_detrend (line 87)
  In detrend_and_epoch (line 236)
  In adam_detrend_and_epoch (line 148)
  In script (line 23)

Do you have an idea of what is going wrong?

Thank you very much!

Hi Johannes,

Thank you for your quick answer! I just tried one participant yet. I will run other participants and remove trials that create this bug if not too often.

Cheers,

Romain