The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Vector subsets of subsets
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

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:

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.