Skip to content

Commit

Permalink
[snirf] allow saving empty 1d vector as timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Sep 15, 2024
1 parent 4b4444f commit 2090320
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion saveh5.m
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ function saveh5(data, fname, varargin)
is1dvector = 0;

if (isa(item, 'timeseries'))
if (item.TimeInfo.Length == 1 || (item.TimeInfo.isUniform && item.TimeInfo.Increment == 1 && ndims(item.Data) == 3 && size(item.Data, 1) == 1 && size(item.Data, 2) == 1))
if (item.TimeInfo.Length == 1 || ...
(item.TimeInfo.isUniform && item.TimeInfo.Increment == 1 && ndims(item.Data) == 3 && size(item.Data, 1) == 1 && size(item.Data, 2) == 1) || ...
(isempty(item.Time) && isempty(item.Data) && size(item.Time, 2) == 1))
is1dvector = 1;
item = squeeze(item.Data);
else
Expand Down

0 comments on commit 2090320

Please sign in to comment.