LIMO-EEG-Toolbox / limo_tools

Hierarchical Linear Modelling for MEEG data
https://limo-eeg-toolbox.github.io/limo_meeg/
Other
59 stars 27 forks source link

Error: Incorrect electrode number on Course Plot #31

Closed pranaysy closed 4 years ago

pranaysy commented 5 years ago

Plotting single subject ERP time-courses using the 'Course Plot' option in limo_results throws an error if any electrode other than the 1st one is selected.

The culprit seems to be line 805 of limo_display_results:
elseif electrode > size(LIMO.data.chanlocs,1) || electrode < 1

should instead be:
elseif electrode > size(LIMO.data.chanlocs,2) || electrode < 1

I was able to successfully plot time courses after this change.
The same code for time-frequency plotting on line 784 of limo_display_results is correct.

CPernet commented 4 years ago

thanks for reporting these

typically, chanlocs if N*1 structure array, copied from the EEG struct -- your seems the other way around; that's ok I pushed a fix using length rather than size so it accommodates both cases

cyril