Get time span between two outcomes of a random pick
Show older comments
I have two vectors, in one (a) there are the outcomes of a random pick (e.g. random letters from the alphabet) and in the other (b) the date of the pick (in numbers). For example:
a=[a;b;a;c;b;b;f;a] b=[42653; 42649; 42642; 42641; 42636; 42634; 42632; 42632]
I'm looking for a way to get a vector (c) in which I have the time span between the time of the pick and the time that outcome came out previously. In this case c should be:
c=[11; 15; 10; 0; 2; 0; 0; 0]
Accepted Answer
More Answers (0)
Categories
Find more on Time Series Events 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!