Added support for plotting the derivative. Amended README

This commit is contained in:
@CarlWachter
2023-01-20 12:54:48 +01:00
parent 3a19f862ad
commit 0273699c25
4 changed files with 9 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
function diffPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, xAxis, channels, path, order)
function diffPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, xAxis, channels, path)
%Iterate through all channels
for channel = 1:width(data)
@@ -43,6 +43,10 @@ function diffPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, xAxis,
figure(channel)
plot(timeArray, yData, '-b');
hold all
%shorten time array to match lost value from diff
timeArray(end) = [];
plot(timeArray, diff(yData), '-r');
ylabel(yAxis{channel}.Value);
xlabel(xAxis{channel}.Value);
@@ -50,7 +54,7 @@ function diffPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, xAxis,
title(channels{channel});
%Save plot
saveFigs('median', figure(channel), channels(channel), path, fileSettings{1}.Value)
saveFigs('derivative', figure(channel), channels(channel), path, fileSettings{1}.Value)
%reset
hold off