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

Binary file not shown.

View File

@ -115,9 +115,8 @@ One last disclaimer: If there is a mistake in the data set, if you use a comma i
There are numerous functionalities still missing. The following list provides an overview of all important functions, that should be added as soon as possible (more or less). The order of precedence represents the priority. There are numerous functionalities still missing. The following list provides an overview of all important functions, that should be added as soon as possible (more or less). The order of precedence represents the priority.
1. Merge plots (more than one data set in a single plot) Maybe another tool for that? 1. Merge plots (more than one data set in a single plot) Maybe another tool for that?
2. Choose the order of the move mean filter 4. Add a custom x-axis label
3. Add a custom x-axis label 5. Add the option for a derivation plot
4. Add the option for a derivation plot 6. Add try and catch statements around every user input
5. Add try and catch statements around every user input
You are very welcome to help develop this tool further. If you are planning to do so, please send me a message (Max Heckmann) and I give you a short introduction in the already existing code. This probably saves you some time. You are very welcome to help develop this tool further. If you are planning to do so, please send me a message (Max Heckmann) and I give you a short introduction in the already existing code. This probably saves you some time.

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