Я хочу построить результат для raw и window: 10 50 100 все на одном графике, используя для l oop Этот график я получаю
ниже мой код
%Read data in
data = csvread('z_flip_data_60BPM.csv');
%Assign columns from csv
z_raw = data(:,2); %Raw signal from data collection
time = data(:,1)/1000; %time converted to seconds
plot(time,z_raw);
hold on
%Change window size as required
window = [10 50 100];
%sanity check to avoid improper window size settings
if window>length(z_raw)
return;
end
%Indexing for the filtered array
j = 1;
%Moving average window filter + basic plot
for i = window+1:(length(z_raw))
filtered_z(j) = mean(z_raw(i-window:i));
j = j+1;
plot(filtered_z);
hold on
end
hold off