mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sw-plotting-tool.git
synced 2025-06-10 01:55:59 +00:00
24 lines
648 B
Matlab
24 lines
648 B
Matlab
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
|
|
|