Skip to content

Commit

Permalink
Merge pull request fieldtrip#2453 from contsili/ft_read_data
Browse files Browse the repository at this point in the history
Prevent MATLAB crash on Windows due to sparse matrix in read_trigger function
  • Loading branch information
contsili authored Oct 25, 2024
2 parents 264f576 + 8592b14 commit 6073f5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions fileio/ft_read_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,7 @@
ft_hastoolbox('mne', 1);
if (hdr.orig.iscontinuous)
dat = fiff_read_raw_segment(hdr.orig.raw,begsample+hdr.orig.raw.first_samp-1,endsample+hdr.orig.raw.first_samp-1,chanindx);
dat = full(dat); % prevent MATLAB crash on Windows due to 'dat' being a sparse matrix, see issue 2451
dimord = 'chans_samples';
elseif (hdr.orig.isepoched)
% permutation of the data matrix is time consuming, and offsets the time gained by not
Expand Down
2 changes: 1 addition & 1 deletion test/test_bug1404.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% MEM 1gb
% WALLTIME 00:10:00
% DEPENDENCY ft_read_header ft_read_data ft_read_spike
% DATA no
% DATA private

% this is only available on the DCCN mentat cluster
dataset = '/home/common/matlab/fieldtrip/data/test/original/neurosim/signals';
Expand Down

0 comments on commit 6073f5d

Please sign in to comment.