mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sw-plotting-tool.git
synced 2025-06-10 01:55:59 +00:00
44 lines
1.2 KiB
Matlab
44 lines
1.2 KiB
Matlab
function meanPlotFnc(data, fileSettings, checkboxes, start, stop, yAxis, channels, path)
|
|
|
|
%Iterate through all channels
|
|
for channel = 1:width(data)
|
|
|
|
%If Graph is checked
|
|
if checkboxes{channel}.Value == 1
|
|
|
|
%Convert start and ending time
|
|
beginning = str2double(start{channel}.Value);
|
|
ending = str2double(stop{channel}.Value);
|
|
|
|
%if first row increment is not checked
|
|
if fileSettings{2}.Value == 0
|
|
[timeArray, yData] = timeAxisWithIncrement(data, fileSettings{3}.Value, beginning, ending, channel);
|
|
else
|
|
%TO DO
|
|
end
|
|
|
|
|
|
%Plot the channel
|
|
figure(channel)
|
|
plot(timeArray, yData, '-b');
|
|
hold all
|
|
plot(timeArray, movmean(yData, 20), '-r');
|
|
ylabel(yAxis{channel}.Value);
|
|
xlabel('Time [s]');
|
|
legend('Without movmean','With movmean (20th order)')
|
|
title(channels{channel});
|
|
|
|
%Save plot
|
|
saveFigs('median', figure(channel), channels(channel), path, fileSettings{1}.Value)
|
|
|
|
%reset
|
|
hold off
|
|
close all;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|