How to use cumsum + interp1q on reset values.
Show older comments
[ 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 ]
cumsum with reset '3' value and delete repeated values
[ 0 0 0 0 1 0 0 2 0 0 3 0 0 0 1 0 2 0 3 0 0 1 0 0 2 0 0 3 0 0 0 1]
interp1q to fill in 0s
[ 0 0.25 0.5 0.75 1 1.33 1.67 2 2.33 2.67 3 0.33 0.67 1 1.33 1.67 2 2.33 2.67 3 0 0.25 0.5 0.75 1 ]
I tried several ways.., but I can't find a way.
1 Comment
Hyowon Lee
on 18 Nov 2015
Accepted Answer
More Answers (0)
Categories
Find more on Introduction to Installation and Licensing 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!