pop_loadBCI2000.m error when passing cell array of filenames

Known Issues and Problems with BCI2000
Locked
boulay
Posts: 382
Joined: 25 Dec 2011, 21:14

pop_loadBCI2000.m error when passing cell array of filenames

Post by boulay » 02 Dec 2012, 21:55

Using revision 0.31 (latest as of today according to SVN).
I tried e-mailing Clemens Brunner directly but the mail bounced back.

Dear Clemens Brunner,

I am using Revision 0.31 of pop_loadBCI2000.m and ran into an error when passing in a cell array of filenames as the first argument. The error was:

Code: Select all

Undefined function or variable "totalSamples".

Error in pop_loadBCI2000 (line 122)
            fileBorders(k) = fileBorders(k - 1) + totalSamples(k - 1);  end
So I edited from line 106 as follows:

Code: Select all

    if iscell(fileName)  % Multiple file names in a cell array
        files = cell2struct(fileName, 'name', 1);
    else  % Just a string (possibly containing wildcards)
        files = dir(fileName);
        for k = 1:length(files)
            files(k).name = fullfile(fileparts(fileName), files(k).name);  % Add full path to each file name
        end
    end
    totalSamples = zeros(1, length(files));
    for k = 1:length(files)
        [~, ~, ~, totalSamples(k)] = load_bcidat(files(k).name, [0, 0]);  % Get length of each individual file
    end
If there's a better way to report a bug then let me know.
Cheers,
Chad

Locked

Who is online

Users browsing this forum: No registered users and 1 guest