Split vector to sub vectors of equal size
2 views (last 30 days)
Show older comments
I have a lond vector of measurements taken every 15 mins for 3 months and want to seperate this in measurements of each day
What should I use?
0 Comments
Answers (1)
Star Strider
on 11 Dec 2021
If the sampling times are uniform (constant sampling intervals between the observations) use the Signal Processing Toolbox buffer function.
v = randn(1,4*24*2) % Two Days' Measurements
rowLengths = 24*60/15;
vdays = buffer(v, rowLengths)
The reshape function is also an option, however buffer is easier to use.
I have a simple emulation of the buffer function (does not do everything) I can post if theSignal Processing Toolbox is not available.
.
0 Comments
See Also
Categories
Find more on Sparse Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!