mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sw-plotting-tool.git
synced 2025-12-16 18:18:03 +00:00
Initialization
This commit is contained in:
23
timeAxisWithIncrement.m
Normal file
23
timeAxisWithIncrement.m
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user