Initialization

This commit is contained in:
Max Heckmann
2022-12-30 22:44:46 +01:00
parent 4456b5c7bf
commit f5df07157d
8 changed files with 212 additions and 0 deletions

23
timeAxisWithIncrement.m Normal file
View File

@@ -0,0 +1,23 @@
function [timeAxis, yData] = timeAxisWithIncrement(data, increment, beginning, ending, channel)
if ending ~= 0
timeAxis = 0:increment:ending;
else
timeAxis(1) = increment;
for i = 2:height(data)
timeAxis(i) = increment + timeAxis(i-1);
end
end
yData = data(:, channel);
yData = yData(1:length(timeAxis));
if beginning ~= 0
tempTimeArray = beginning:increment:timeAxis(end);
startIndex = length(timeAxis) - length(tempTimeArray);
yData = yData(startIndex+1:startIndex+length(tempTimeArray));
timeAxis = tempTimeArray;
end
end