Skip to content

Commit 7568a4c

Browse files
committed
Small fix for load_xdf (where the time series is empty)
1 parent b442f8d commit 7568a4c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dependencies/xdfimport1.14/load_xdf.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,12 @@
515515
else
516516
% calculate effective sampling rate
517517
for k=1:length(temp)
518-
temp(k).effective_srate = length(temp(k).time_stamps) / (temp(k).time_stamps(end) - temp(k).time_stamps(1)); end
518+
if ~isempty(temp(k).time_stamps)
519+
temp(k).effective_srate = length(temp(k).time_stamps) / (temp(k).time_stamps(end) - temp(k).time_stamps(1));
520+
else
521+
temp(k).effective_srate = NaN;
522+
end
523+
end
519524
end
520525

521526
% copy the information into the output

0 commit comments

Comments
 (0)