How to find the time of event?
Show older comments
Hi! I have a matrix with two columns. The first column is time and the second one is events consisted of 0 and 1 only. I would like to know the time when the event (1) happend. How can I do this?
As an example, the matrix is:
0 0
2.53164556962025 0
5.06329113924051 0
7.59493670886076 0
10.1265822784810 0
12.6582278481013 0
15.1898734177215 0
17.7215189873418 0
20.2531645569620 0
22.7848101265823 1
25.3164556962025 1
27.8481012658228 1
30.3797468354430 1
32.9113924050633 1
35.4430379746836 0
In the end I want to get an answer about what time the first 1 appeared. So for this example it should be:
ans = 22.7848101265823
Thanks for any help!
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!