Skip to content

Commit

Permalink
update readme file and using cell array instead of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodelorme committed Nov 15, 2024
1 parent f00be5d commit 832fe15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pop_loadxdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,24 +109,25 @@

% decode parameters
% -----------------
options = [];
options = {};
if ~isempty(result{1}) && result{1} ~= 1
options = [options ', ''streamname'', ''' allStreamNames{result{1}} ''''];
options = [options { 'streamname' allStreamNames{result{1}} } ];
end
if ~isempty(result{2}) && result{1} == 1
options = [options ', ''streamtype'', ''' allStreamTypes{result{2}} ''''];
options = [options { 'streamtype' allStreamTypes{result{2}} } ];
end
if ~isempty(result{3}) && ~isequal(result{3}, 1)
options = [options ', ''fuse_stream_names'', ' vararg2str( { allStreamNames( result{3} ) } ) ];
options = [options { 'fuse_stream_names' allStreamNames( result{3} ) } ];
end
if ~isempty(result{4}) && ~isequal(result{4}, 1)
options = [options ', ''exclude_markerstreams'', ' vararg2str( { markerOptions( result{4} ) } ) ];
options = [options { 'exclude_markerstreams' markerOptions( result{4} ) } ];
end
if result{5} == 1
options = [options ', ''effective_rate'', true' ];
options = [options { 'effective_rate' true } ];
end
else
options = vararg2str(varargin);
streams = {};
options = varargin;
end

% load data
Expand All @@ -138,17 +139,13 @@
end

fprintf('Now importing...');
if nargin > 0
EEG = eeg_load_xdf(fullFileName, varargin{:});
else
eval( [ 'EEG = eeg_load_xdf( fullFileName ' options ');' ]);
end
EEG = eeg_load_xdf( fullFileName, 'streams', streams, options{:});
fprintf('done.\n');

EEG = eeg_checkset(EEG);

if length(options) > 2
command = sprintf('EEG = pop_loadxdf(''%s'' %s);',fullFileName, options);
command = sprintf('EEG = pop_loadxdf(''%s'', %s);',fullFileName, vararg2str(options));
else
command = sprintf('EEG = pop_loadxdf(''%s'');',fullFileName);
end
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ To use `load_xdf` directly:
As usual in MATLAB, to get the documentation of the function, type `help load_xdf` or `doc load_xdf`.

# Version note
- version 1.2 multistream import (backward compatible)
- version 1.19 includes MATLAB binaries
- version 1.18 implement fix for g.tek files
- Version 1.17 fixes to Matlab XDF importer
Expand Down

0 comments on commit 832fe15

Please sign in to comment.