Time range from 0 to 0 now outputs all data on CSV files too

This commit is contained in:
@CarlWachter 2023-01-17 19:58:37 +01:00
parent 580e873d6f
commit 2c7380d0dc
4 changed files with 63 additions and 45 deletions

Binary file not shown.

View File

@ -14,22 +14,28 @@ function fourierPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, chan
if fileSettings{2}.Value == 0 if fileSettings{2}.Value == 0
[timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel); [timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel);
else else
timeIndex = 1; if ending == 0
while data(timeIndex,1) < str2double(start{channel}.Value) timeArray = data(:,1);
timeIndex = timeIndex + 1; yData = data(:, channel);
end else
startIndex = timeIndex; timeIndex = 1;
while data(timeIndex,1) < str2double(start{channel}.Value)
while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data) timeIndex = timeIndex + 1;
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1); end
timeIndex = timeIndex + 1;
end startIndex = timeIndex;
endIndex = timeIndex; while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data)
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1);
for timeIndex = startIndex:endIndex - 1 timeIndex = timeIndex + 1;
yData(timeIndex - startIndex + 1) = data(timeIndex, channel); end
endIndex = timeIndex;
for timeIndex = startIndex:endIndex - 1
yData(timeIndex - startIndex + 1) = data(timeIndex, channel);
end
end end
end end

View File

@ -15,22 +15,28 @@ function graphPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channe
[timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel); [timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel);
else else
timeIndex = 1; if ending == 0
while data(timeIndex,1) < str2double(start{channel}.Value) timeArray = data(:,1);
timeIndex = timeIndex + 1; yData = data(:, channel);
end else
startIndex = timeIndex; timeIndex = 1;
while data(timeIndex,1) < str2double(start{channel}.Value)
while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data) timeIndex = timeIndex + 1;
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1); end
timeIndex = timeIndex + 1;
end startIndex = timeIndex;
endIndex = timeIndex; while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data)
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1);
for timeIndex = startIndex:endIndex - 1 timeIndex = timeIndex + 1;
yData(timeIndex - startIndex + 1) = data(timeIndex, channel); end
endIndex = timeIndex;
for timeIndex = startIndex:endIndex - 1
yData(timeIndex - startIndex + 1) = data(timeIndex, channel);
end
end end
end end

View File

@ -14,22 +14,28 @@ function meanPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channel
if fileSettings{2}.Value == 0 if fileSettings{2}.Value == 0
[timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel); [timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel);
else else
timeIndex = 1; if ending == 0
while data(timeIndex,1) < str2double(start{channel}.Value) timeArray = data(:,1);
timeIndex = timeIndex + 1; yData = data(:, channel);
end else
startIndex = timeIndex; timeIndex = 1;
while data(timeIndex,1) < str2double(start{channel}.Value)
while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data) timeIndex = timeIndex + 1;
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1); end
timeIndex = timeIndex + 1;
end startIndex = timeIndex;
endIndex = timeIndex; while data(timeIndex, 1) <= str2double(stop{channel}.Value) || timeIndex >= length(data)
timeArray(timeIndex - startIndex + 1) = data(timeIndex,1);
for timeIndex = startIndex:endIndex - 1 timeIndex = timeIndex + 1;
yData(timeIndex - startIndex + 1) = data(timeIndex, channel); end
endIndex = timeIndex;
for timeIndex = startIndex:endIndex - 1
yData(timeIndex - startIndex + 1) = data(timeIndex, channel);
end
end end
end end