How do I apply a sliding window on an array??
2 views (last 30 days)
Show older comments
How do I apply a sliding window on a matrix 23x1843200 with a window size 23x768??
%% input
data matrix
DDD=load('data.mat');
data=DDD.data;
N_max=length(data);
window_size=256*3; %% 256 for 1 second ==> 3 seconds
step_win=128*3; %% overlapping window ...by 50%
count=0;
for n_start = 1:step_win:(N_max-window_size)
count=count+1;
segment=data(n_start:(n_start+ window_size-1));
end
plot(segment)
xlabel('time')
grid on;
title('last segment of channel1');
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!