I have a set of data that I need to analyse. I am trying to work out how to use a for loop to partition the data into 5 – 10 second blocks. I am very new to MatLab and have no idea how i would go about doing this. Any help would be much appreciated.
Share
Assuming you have a vector of samples
x, and a sampling frequencyfs(in Hz), then you can first reshape your vector into a matrix:where
Wis the window length (in seconds). Each column in now a separate window of data.1You can then process each window (i.e. each column) in turn:
1. This assumes that
xcontains an exact integer number of windows.