ERPLAB Toolbox is a free, open-source Matlab package for analyzing ERP data. It is tightly integrated with EEGLAB Toolbox, extending EEGLAB’s capabilities to provide robust, industrial-strength tools for ERP processing, visualization, and analysis. A graphical user interface makes it easy for beginners to learn, and Matlab scripting provides enormous power for intermediate and advanced users.
Disclaimer: I'm not using erplab in the regular way, but try to make use of the continuous artefact rejection function. In this case the error should occur always not specific to my usage. But then I don't know if erplab does something different somewhere.
In joinclosesegments.m the last line (104) is:
WinRej2(end+1,:) = WinRej(end,:); % Save/append the last rejection window
This enhances the size of the output WinRej by one, but the ChanRej is not enhanced. Thus as called in _popcontinuousartefact.m
subsequently the function crashes because in Line 413 it tries to do:
matrixrej = [WinRej colormatrej chanrej];
which does not work if the matrices are of unequal size.
Proposed fix:
Add another line to joinclosesegments.m thus that line 104 and new 105 now say:
WinRej2(end+1,:) = WinRej(end,:); % Save/append the last rejection windowChanRej2(end+1,:) = chanrej(end,:); % Save/append the last rejection window
Disclaimer: I'm not using erplab in the regular way, but try to make use of the continuous artefact rejection function. In this case the error should occur always not specific to my usage. But then I don't know if erplab does something different somewhere.
In joinclosesegments.m the last line (104) is:
WinRej2(end+1,:) = WinRej(end,:); % Save/append the last rejection window
This enhances the size of the output WinRej by one, but the ChanRej is not enhanced. Thus as called in _popcontinuousartefact.m
-
[WinRej, chanrej ] = joinclosesegments(WinRej, chanrej, shortisisam);
size(WinRej)
ans = (14, 2)size(chanrej)
ans = (13, 2 )subsequently the function crashes because in Line 413 it tries to do:
matrixrej = [WinRej colormatrej chanrej];
which does not work if the matrices are of unequal size.Proposed fix: Add another line to joinclosesegments.m thus that line 104 and new 105 now say:
WinRej2(end+1,:) = WinRej(end,:); % Save/append the last rejection window
ChanRej2(end+1,:) = chanrej(end,:); % Save/append the last rejection window