Skip to content

Commit

Permalink
ENH - provide informative error if reshape into matrix fails (fieldtr…
Browse files Browse the repository at this point in the history
  • Loading branch information
schoffelen authored Feb 1, 2024
1 parent 1307a7a commit b525618
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions external/mne/fiff_read_raw_segment.m
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,20 @@
% Depending on the state of the projection and selection
% we proceed a little bit differently
%
if numel(tag.data)==nchan.*this.nsamp;
dat = double(reshape(tag.data, nchan, this.nsamp));
else
error(me, 'mismatch between actual and expected number of data elements in tag, possibly the datafile is corrupted');
end
if isempty(mult)
if isempty(sel)
one = cal*double(reshape(tag.data,nchan,this.nsamp));
one = cal*dat;
else
one = double(reshape(tag.data,nchan,this.nsamp));
one = dat;
one = cal*one(sel,:);
end
else
one = mult*double(reshape(tag.data,nchan,this.nsamp));
one = mult*dat;
end
end
%
Expand Down

0 comments on commit b525618

Please sign in to comment.