Split vector to sub vectors of equal size
Afficher commentaires plus anciens
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?
Réponses (1)
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.
.
Catégories
En savoir plus sur Sparse Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!