Skip to content

Commit

Permalink
fix some naming errors in the util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bendichter committed Feb 19, 2021
1 parent 9273e0b commit 67e5f76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions +util/loadEventAlignedTimeSeriesData.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@
downsample_factor = 1;
end

if ~exist('electrode','var')
electrode = [];
if ~exist('electrodes','var')
electrodes = [];
end

fs = timeseries.starting_time_rate;
inds_len = diff(window) * fs / downsample_factor;

dims = timeseries.data.dims;

if isempty(electrode)
if isempty(electrodes)
D = NaN(length(times), dims(1), int16(inds_len));
for i = 1:length(times)
D(i,:,:) = util.loadTimeSeriesData(timeseries, window + times(i), ...
downsample_factor, electrodes);
end
else
D = NaN(length(times), inds_len);
D = NaN(length(times), length(electrodes), inds_len);
for i = 1:length(times)
D(i,:) = util.loadTimeSeriesData(timeseries, window + times(i), ...
downsample_factor, electrodes);
D(i,:,:) = reshape(util.loadTimeSeriesData(timeseries, window + times(i), ...
downsample_factor, electrodes)', [1 length(electrodes) inds_len]);
end
end
12 changes: 6 additions & 6 deletions +util/loadTimeSeriesData.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
downsample_factor = 1;
end

if ~exist('electrode', 'var')
electrode = [];
if ~exist('electrodes', 'var')
electrodes = [];
end

if length(electrodes) > 1
fs = timesries.starting_time_rate;
fs = timeseries.starting_time_rate;
data = NaN(diff(interval) * fs, length(electrodes));
for i = 1:length(electrodes)
data(:,i) = loadTimeSeriesData(timeseries, interval, ...
data(:,i) = util.loadTimeSeriesData(timeseries, interval, ...
downsample_factor, electrodes(i));
end
else
Expand Down Expand Up @@ -73,8 +73,8 @@
count = dims;
count(end) = round((end_ind - start_ind) / downsample_factor);

if ~isempty(electrode)
start(end-1) = electrode;
if ~isempty(electrodes)
start(end-1) = electrodes;
count(end-1) = 1;
end

Expand Down

0 comments on commit 67e5f76

Please sign in to comment.