Question

MatLAB noob here..

I have a 2 column matrix with start/end (in seconds) times - in a 2 column matrix. I also have a single column matrix of time stamps. How do I find the time stamps that occur in each interval?

Was it helpful?

Solution

Not going to put any code here, as you provided none. There are some alternatives, this is the most straight forward (though might not be the most efficient for the computer):

Use a for loop, for each line of your start/end matrix, and for each do another for loop for each element in your time stamp matrix, and assess, using if function, if each time stamp is between start and end times. If you don't know how to use FOR and IF, type help FOR, help IF and find out. Or google it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top