Skip to content

fit_eeg_distribution in asr_calibrate crash #3

@arnodelorme

Description

@arnodelorme

Transfered from https://sccn.ucsd.edu/bugzilla/show_bug.cgi?id=13115

The line: H = bsxfun(@times,X(1:m,:),nbins./X(m,:)); also crashes when m = 0;

[reply] [−]DescriptionTyler Grummett 2017-07-18 17:55:02 PDT

In the clean_rawdata0.32 toolbox, I am having an issue with the fit_eeg_distribution function, which is a function within the asr_calibration function. The error is as follows:

Error using bsxfun
Non-singleton dimensions of the two input arrays must match each
other.

Error in asr_calibrate>fit_eeg_distribution (line 377)
kl =
sum(bsxfun(@times,p,bsxfun(@minus,log(p),logq(1:end-1,:)))) +
log(m);

Error in asr_calibrate (line 180)
[mu(c),sig(c)] =
fit_eeg_distribution(rms,min_clean_fraction,max_dropout_fraction);

Error in clean_asr (line 164)
state = asr_calibrate(ref_section.data,ref_section.srate,cutoff);

Error in clean_artifacts (line 219)
EEG =
clean_asr(EEG,burst_crit,[],[],[],burst_crit_refmaxbadchns,burst_crit_reftolerances,[]);
end

Error in clean_rawdata (line 83)
cleanEEG = clean_artifacts(EEG, 'FlatlineCriterion', arg_flatline,...

Looking into it a little further, it appear as though logq only has one row of numbers, so it crashes when it tries to grab logq(1:end-1,:). This occurs when m = 1, n = 6 (X is a 3x6 matrix of numbers), and therefore H is a row of NaNs.

Please note that this is one set of data which didnt work out of a large number of tasks and subjects, so it is working for the vast majority of the time.

Regards,
Tyler

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions