codefail
codefail

Reputation: 381

Find time stamps in a given time interval (start/end) in a 2 column matrix

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?

Upvotes: 1

Views: 70

Answers (1)

Inox
Inox

Reputation: 2275

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

Upvotes: 1

Related Questions