Breaking and spliting vector into groups and averaging
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have a long one-dimensional time vector that I want to split in chunks and average each chunk. I have another logical vector (same length) of 0s and 1s that changes the sign to signal each chunk transition. How could I easily use the information on the logical vector to select each chunk of the time vector?
Thanks!
timevec = [0 2 3 4 5 0 9 3 4];
chunk = [0 0 0 1 1 1 1 0 0];
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Find more on Matrices and Arrays 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!