|
com = sprintf('EEG = pop_subcomp( EEG, [%s], %d);', int2str(componentsOri(:)'), plotag); |
The GUI “Or list of component(s) to retain” path in pop_subcomp() appears to execute with keepflag = 1 internally, but the command history string written to com/eegh drops that flag. On line 232, the function always formats the history as EEG = pop_subcomp( EEG, [components], plotag);, so a GUI action like “keep only component 2” is recorded as EEG = pop_subcomp( EEG, [2], 0); instead of EEG = pop_subcomp( EEG, [2], 0, 1);. Re-running the saved command therefore reverses the intended semantics and removes component 2 rather than keeping only component 2. The fix should be to include keepflag when constructing com so GUI retain operations are faithfully reproduced in history.
eeglab/functions/popfunc/pop_subcomp.m
Line 232 in 4207693
The GUI “Or list of component(s) to retain” path in pop_subcomp() appears to execute with keepflag = 1 internally, but the command history string written to com/eegh drops that flag. On line 232, the function always formats the history as EEG = pop_subcomp( EEG, [components], plotag);, so a GUI action like “keep only component 2” is recorded as EEG = pop_subcomp( EEG, [2], 0); instead of EEG = pop_subcomp( EEG, [2], 0, 1);. Re-running the saved command therefore reverses the intended semantics and removes component 2 rather than keeping only component 2. The fix should be to include keepflag when constructing com so GUI retain operations are faithfully reproduced in history.