Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Vector subsets of subsets
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Dax

Posts: 2
Registered: 4/15/11
Vector subsets of subsets
Posted: Apr 15, 2011 3:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.