Commit 9ae36692 authored by Markus Mueller-Trapet's avatar Markus Mueller-Trapet

get sampling rate depending on type of available data

parent abf12e1b
...@@ -49,7 +49,12 @@ channelUnits = cell(1,nDataSet); ...@@ -49,7 +49,12 @@ channelUnits = cell(1,nDataSet);
nodes = zeros(nDataSet,1); nodes = zeros(nDataSet,1);
switch ds.abscissaUnitsLabel switch ds.abscissaUnitsLabel
case 's' % data from B&K Pulse or other measurement systems case 's' % data from B&K Pulse or other measurement systems
SamplingRate = round(1./DataSet{1}.dx); if ~isempty(ds.dx)
SamplingRate = 1./ds.dx;
else
SamplingRate = median(1./diff(unique(abscissa)));
end
SamplingRate = round(SamplingRate,-1);
for i=1:nDataSet %Read the data into the variables for i=1:nDataSet %Read the data into the variables
y = DataSet{i}.measData(:); y = DataSet{i}.measData(:);
if ~isempty(y) if ~isempty(y)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment