Average time spent in a region

5 views (last 30 days)
Aryeh
Aryeh on 29 Jan 2014
Commented: Walter Roberson on 29 Jan 2014
I am trying to calculate the percentage of time spent by an object in a specified region over a given period of time. I have a file tracking the coordinates of the object in the only axis that I care about(let's say the x axis). The file is just a vector with each point corresponding to where the object is in the frame of the recording. I imagine that I can create a counter that starts at zero and while I'm looking at the, let's say, 2700th to 5400th coordinate point, if x is greater than a specified amount, 1 is added to the counter. Then I could take the total number of counts and divide it by the total number of x coordinate points to calculate the percentage of time spent in that region. Thanks so much for all your help!
  1 Comment
Walter Roberson
Walter Roberson on 29 Jan 2014
Are the points equally-spaced in time? Or should the object be assumed to stay at a point until it suddenly "jumps" to the next point? Are the points only x, or are they x and y?

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!