Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Dax
Posts:
2
Registered:
4/15/11


Vector subsets of subsets
Posted:
Apr 15, 2011 3:01 PM


I am trying to find the subset of a subset of a vector while preserving the indices.
I have a vector of times that I want a portion of: t=[t(1):t(700)] where t(1)=3:00 and t(700)=900
tgood=find(t>4.5 & t<7.6); This returns indices 155:456;
Now I want all the times who's spacing is greater than 27 seconds within my original subset... ie I want a group of indices that are some subset of 155:456:
I tried: index=find(diff(t(tgood))>27)
But this returns indices 1:302.... so it found the values I want but did not preserve my indices.
What is the elegant solution?



