Can’t load datasets in EEGLAB using script
I’m trying to create a loop that can load and preprocess EEG data sets, here is my code and the reoccuring error
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );
%% Get the list of subjects to load:
dataset = uigetdir;%allows user to manually select the folder where the data sets are stored
subjectlist = dir(dataset);
subjectlist = subjectlist(~ismember({subjectlist.name},{‘.’,’..’}));
SUB = {subjectlist(:).name};
filepath = {subjectlist(:).folder};
%%
%load data
for i = 1 : length(SUB)
% 0. Select subject id:
%subject = subjectlist(i);
% Print info to the command window
% display(‘Processing Subject %sn’, SUB(i));
%Define subject path based on study directory and subject ID of current subject
Subject_Path = filepath{i};
Subject_Path = convertCharsToStrings(Subject_Path);
% 1. Load subject data:
% subject_data = load_subject_data(cfg,subject);
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset(‘filename’, SUB{i},’filepath’, Subject_Path);
EEG = eeg_checkset(EEG);
end
eeglab redraw;I’m trying to create a loop that can load and preprocess EEG data sets, here is my code and the reoccuring error
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );
%% Get the list of subjects to load:
dataset = uigetdir;%allows user to manually select the folder where the data sets are stored
subjectlist = dir(dataset);
subjectlist = subjectlist(~ismember({subjectlist.name},{‘.’,’..’}));
SUB = {subjectlist(:).name};
filepath = {subjectlist(:).folder};
%%
%load data
for i = 1 : length(SUB)
% 0. Select subject id:
%subject = subjectlist(i);
% Print info to the command window
% display(‘Processing Subject %sn’, SUB(i));
%Define subject path based on study directory and subject ID of current subject
Subject_Path = filepath{i};
Subject_Path = convertCharsToStrings(Subject_Path);
% 1. Load subject data:
% subject_data = load_subject_data(cfg,subject);
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset(‘filename’, SUB{i},’filepath’, Subject_Path);
EEG = eeg_checkset(EEG);
end
eeglab redraw; I’m trying to create a loop that can load and preprocess EEG data sets, here is my code and the reoccuring error
[ALLEEG, EEG, CURRENTSET] = eeg_store( ALLEEG, EEG, 0 );
%% Get the list of subjects to load:
dataset = uigetdir;%allows user to manually select the folder where the data sets are stored
subjectlist = dir(dataset);
subjectlist = subjectlist(~ismember({subjectlist.name},{‘.’,’..’}));
SUB = {subjectlist(:).name};
filepath = {subjectlist(:).folder};
%%
%load data
for i = 1 : length(SUB)
% 0. Select subject id:
%subject = subjectlist(i);
% Print info to the command window
% display(‘Processing Subject %sn’, SUB(i));
%Define subject path based on study directory and subject ID of current subject
Subject_Path = filepath{i};
Subject_Path = convertCharsToStrings(Subject_Path);
% 1. Load subject data:
% subject_data = load_subject_data(cfg,subject);
[ALLEEG EEG CURRENTSET ALLCOM] = eeglab;
EEG = pop_loadset(‘filename’, SUB{i},’filepath’, Subject_Path);
EEG = eeg_checkset(EEG);
end
eeglab redraw; eeglab, error MATLAB Answers — New Questions