Allows choosing the order of the move mean filter

This commit is contained in:
@CarlWachter
2023-01-19 15:39:30 +01:00
parent 87b0873c08
commit 766744fa0f
3 changed files with 6 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
function meanPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channels, path)
function meanPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channels, path, order)
%Iterate through all channels
for channel = 1:width(data)
@@ -39,15 +39,14 @@ function meanPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channel
end
end
%Plot the channel
figure(channel)
plot(timeArray, yData, '-b');
hold all
plot(timeArray, movmean(yData, 20), '-r');
plot(timeArray, movmean(yData, str2double(order)), '-r');
ylabel(yAxis{channel}.Value);
xlabel('Time [s]');
legend('Without movmean','With movmean (20th order)')
legend('Without movmean', strcat('With movmean (', order, 'th order)'))
title(channels{channel});
%Save plot