Script no longer working, help needed
Show older comments
I have a script that I would run to batch pre-process some data that worked well in the past. I had it on another computer running Matlab but recently installed the Student version R2012a on my personal computer. After adjusting the script to reflect the new directories, it no longer works. I'll post the script as well as the error messages (which I can't make sense of), and any help or suggestions are greatly appreciated!
clear
clc
disp('Working...')
subject = {'Sub_101' 'Sub_102' 'Sub_103' 'Sub_104' 'Sub_105' 'Sub_106' 'Sub_107' 'Sub_108' 'Sub_109' 'Sub_110' 'Sub_111' 'Sub_112' 'Sub_113' 'Sub_114' 'Sub_115' 'Sub_116' 'Sub_117' 'Sub_118' 'Sub_119' 'Sub_120' 'Sub_121' 'Sub_122' 'Sub_123' 'Sub_124' 'Sub_126' 'Sub_127'} %creates a variable called subject which can be a list of files
%User's paths
pathname_read = '/Users/Myname/Documents/York/KE Monolinguals/BDF Data/';
pathname_write = '/Users/Myname/Documents/York/KE Monolinguals/Prearf/';
nsubj = length(subject); %number of subjects
for s=1:nsubj
sname = [pathname_read subject{s} '_KE.bdf'];
if exist(sname, 'file')>0
fprintf('Processing Subject #%g : %s part %g...\n', s, subject{s})
EEG = pop_biosig(sname, 'ref', [65 66]);
EEG = eeg_checkset(EEG);
EEG = pop_chanedit(EEG, 'lookup','/Program Files (x86)/MATLAB/R2012a Student/eeglab12_0_2_0b/plugins/dipfit2.2/standard-10-5-cap385.elp');
EEG = eeg_checkset(EEG);
EEG = pop_creabasiceventlist(EEG, '', {'boundary'}, {-99});
EEG = eeg_checkset(EEG);
EEG = pop_binlister( EEG, '/Users/Myname/Documents/York/KE Monolingual/Scripts/KE_bin_descriptor.m', 'no', '', 0, [], [], 1, 0, 0);
EEG = pop_saveset(EEG, 'filename', [subject{s} '_raw.set'], 'filepath', pathname_write);
EEG = eeg_checkset(EEG);
EEG = pop_basicfilter( EEG, 1:70, 0.01, 80, 2, 'butter', 1, [] );
EEG = eeg_checkset(EEG);
EEG = pop_epochbin( EEG , [-200.0 800.0], 'pre');
EEG = pop_saveset(EEG, 'filename', [subject{s} '_be.set'], 'filepath', pathname_write);
EEG = eeg_checkset(EEG);
else fprintf('\n *** WARNING: %s does not exist *** \n\n', sname);
end
end
And the error message that pops up after running it:
Working...
subject =
Columns 1 through 10
'Sub_101' 'Sub_102' 'Sub_103' 'Sub_104' 'Sub_105' 'Sub_106' 'Sub_107' 'Sub_108' 'Sub_109' 'Sub_110'
Columns 11 through 20
'Sub_111' 'Sub_112' 'Sub_113' 'Sub_114' 'Sub_115' 'Sub_116' 'Sub_117' 'Sub_118' 'Sub_119' 'Sub_120'
Columns 21 through 26
'Sub_121' 'Sub_122' 'Sub_123' 'Sub_124' 'Sub_126' 'Sub_127'
Processing Subject #1 : Sub_101 part Reading data in BDF format... eeg_checkset note: upper time limit (xmax) adjusted so (xmax-xmin)*srate+1 = number of frames Importing data events... eeg_checkset note: creating the original event table (EEG.urevent) Re-referencing... Re-referencing data eeg_checkset note: re-creating the original event table (EEG.urevent) readlocs(): 'BESA' format assumed from file extension Error using readlocs>load_file_or_array (line 624) readlocs(): cannot find the named file or variable, check syntax
Error in readlocs (line 405) array = load_file_or_array( filename, g.skiplines);
Error in pop_chanedit (line 823) tmplocs = readlocs( chaninfo.filename, 'defaultelp', 'BESA' );
Error in KE_prearf (line 24) EEG = pop_chanedit(EEG, 'lookup','/Program Files (x86)/MATLAB/R2012a Student/eeglab12_0_2_0b/plugins/dipfit2.2/standard-10-5-cap385.elp');
Any input is really appreciated, thank you!
2 Comments
dpb
on 28 Aug 2013
Processing Subject #1 : Sub_101 part Reading data in BDF format...
eeg_checkset note: upper time limit (xmax) adjusted so (xmax-xmin)*srate+1 = number of frames
Importing data events...
eeg_checkset note: creating the original event table (EEG.urevent) Re-referencing...
Re-referencing data eeg_checkset
note: re-creating the original event table (EEG.urevent) readlocs(): 'BESA' format assumed from file extension
Error using readlocs
>load_file_or_array (line 624)
readlocs(): cannot find the named file or variable, check syntax
Error in readlocs (line 405)
array = load_file_or_array( filename, g.skiplines);
Error in pop_chanedit (line 823)
tmplocs = readlocs( chaninfo.filename, 'defaultelp', 'BESA' );
Error in KE_prearf (line 24)
EEG = pop_chanedit(EEG, 'lookup','/Program Files (x86)/MATLAB/R2012a Student/eeglab12_0_2_0b/plugins/dipfit2.2/standard-10-5-cap385.elp');
Never used any of the BDF stuff but it looks like there's a name resolution problem down at the bottom -- the first error is the one about "readlocs() can't find the named file or variable, check syntax" the rest after that is the callback stack back to the calling statement in the script.
What, precisely caused it I don't know but that's the klew...
Matthias
on 30 Aug 2013
Answers (0)
Categories
Find more on EEG/MEG/ECoG in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!