Skip to content

Running a for loop with an ICA/AMICA without a window for each participant #39

Description

@p1050666

I'm trying to create a for loop allowing me to run an AMICA for every participant on EEGLab using Matlab. Here's the script. On each participant, I have to click "OK" on a window and I'd like instead to let the program run everything. Is there a way to simply run an AMICA for each participant without having to press "OK" ? I thought setting the EEG.etc.auto_ok to 2 would have worked but it doesn't seem to be the case. Thanks !

`for s=1:nsubj

    fprintf('\n******\nProcessing subject %s\n******\n\n', subject_list{s});

    % Path to the folder containing the current subject's data
    data_path  = [home_path subject_list{s} '/'];
    
    sname      = [data_path subject_list{s} '.set'];
    
    if exist(sname, 'file')<=0
            fprintf('\n *** WARNING: %s does not exist *** \n', sname);
            fprintf('\n *** Skip all processing for this subject *** \n\n');
            
    else
        EEG = pop_loadset('filename', [subject_list{s} '.set'], 'filepath', data_path);
        EEG = pop_runamica(EEG);
        EEG.etc.auto_ok = 2;
        EEG.setname = [EEG.setname '_amicadone'];
        EEG = pop_saveset(EEG, 'filename', [EEG.setname '.set'], 'filepath', data_path)
        
    end    
 end

`

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