Skip to content

Commit edac719

Browse files
committed
Merge pull request #10 from nedaeh/devel
* fixes for MATLAB 2015b compatibility (change to how the stack entri…
2 parents 52e42d0 + 76ebcc8 commit edac719

File tree

4 files changed

+23
-13
lines changed

4 files changed

+23
-13
lines changed

code/arguments/arg_define.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@
371371
% cached wrapper around process_spec
372372
function varargout = process_spec_cached(caller_name,spec,report_type,assign_defaults,perform_namecheck)
373373
persistent cache;
374-
caller_field = caller_name;
374+
caller_field = ['x' caller_name];
375375
caller_field(~((caller_field>='a'&caller_field<='z') | (caller_field>='A'&caller_field<='Z') | (caller_field>='0'&caller_field<='9'))) = '_';
376376
key = [report_type 'a'+assign_defaults];
377377
try
@@ -501,7 +501,7 @@
501501
signature(structmask) = cellfun(@fieldnames,signature(structmask),'UniformOutput',false); end
502502

503503
% determine the number n of arguments that were specified positionally
504-
caller_field = caller_name;
504+
caller_field = ['x' caller_name];
505505
caller_field(~((caller_field>='a'&caller_field<='z') | (caller_field>='A'&caller_field<='Z') | (caller_field>='0'&caller_field<='9'))) = '_';
506506
[n,violations,ignored] = hlp_nanocache(caller_field,10,@get_num_positionals,fmt,length(first_names),signature,structmask,permitted_names,skipped_positionals);
507507

code/helpers/hlp_resolve.m

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,18 @@
5454
end
5555

5656
% check for all entries whether they refer to a stack frame...
57-
marker = 'make_func/@(f,a,frame__';
58-
frames = find(strncmp(entries,marker,23));
59-
57+
if hlp_matlab_version < 806
58+
marker = 'make_func/@(f,a,frame__';
59+
else
60+
marker = '@(f,a,frame__';
61+
end
62+
frames = find(strncmp(entries,marker,length(marker)));
63+
64+
6065
% go through all stack frames...
6166
symbol = char(x);
6267
for k=frames
63-
frameid = entries{k}(24:end-14);
68+
frameid = entries{k}(length(marker)+1:end-14);
6469
% and check if the symbol is present there, then look up
6570
if isfield(tracking.stack.frames.(frameid),symbol)
6671
outargs = tracking.stack.frames.(frameid).(symbol);

code/utils/utl_whichfile.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ function populate_records(path)
6565
populate_records([path filesep info.name]); end
6666
else
6767
% found a file? add it to the table if an .m file
68-
if length(info.name) > 2 && strcmp(info.name(end-1:end),'.m')
69-
filenames.(info.name(1:end-2)) = [path filesep info.name]; end
68+
if length(info.name) > 2 && strcmp(info.name(end-1:end),'.m')
69+
try
70+
filenames.(info.name(1:end-2)) = [path filesep info.name];
71+
catch
72+
disp_once('utl_whichfile: found .m file that is not a function name: %s (ignoring)',[path filesep info.name]);
73+
end
74+
end
7075
end
7176
end
7277
end

userscripts/tutorial_erd1.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
%% --- using the Common Spatial Pattern method ---
1919

2020
% load the data set (BCI2000 format)
21-
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat');
21+
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat','channels',1:29);
2222

2323
% define the approach (here: Common Spatial Patterns without any customization)
2424
myapproach = 'CSP';
@@ -33,7 +33,7 @@
3333
%% --- using the Common Spatial Pattern method with some custom options ---
3434

3535
% load the data set (BCI2000 format)
36-
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat');
36+
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat','channels',1:29);
3737

3838
% define the approach
3939
% Note: The settings found in the GUI "Review/Edit Approach" Panel can be translated literally
@@ -81,7 +81,7 @@
8181
% may run into a local optimum or over-fit spuriously correlated bands
8282

8383
% load the data set
84-
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat');
84+
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat','channels',1:29);
8585

8686
% define the approach
8787
myapproach = {'SpecCSP' 'SignalProcessing',{'EpochExtraction',[0.5 3]}};
@@ -97,7 +97,7 @@
9797
% ( click into the figure to stop the update (and make sure that your click was registered) )
9898

9999
% load feedback session
100-
testdata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/feedback/DanielS001R01.dat');
100+
testdata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/feedback/DanielS001R01.dat','channels',1:29);
101101

102102
% play it back in real time
103103
run_readdataset('Dataset',testdata);
@@ -115,7 +115,7 @@
115115
% (the number of pattern pairs found optimal should be 3 in this case)
116116

117117
% load the data set (BCI2000 format)
118-
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat');
118+
traindata = io_loadset('bcilab:/userdata/tutorial/imag_movements1/calib/DanielS001R01.dat','channels',1:29);
119119

120120
% define approach
121121
myapproach = {'CSP' 'Prediction',{'FeatureExtraction',{'PatternPairs',search(1,2,3)}}};

0 commit comments

Comments
 (0)