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: extracting specific numbers from a vector or a matrix
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 50
Registered: 5/1/13
extracting specific numbers from a vector or a matrix
Posted: May 1, 2013 6:21 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


If I have a matrix that contains two vectors each value is related to the corresponded one... eg :
matrix: 2 4 6 8 10 12 14 16 ....etc
3 4 3 3 5 6 7 8 ....etc

These numbers represent two groups: groups. each group last for 30 times then the other group starts and so one....the length of it is 1400 and I want is to extract the values for group 1 which will be 700.

To rexplain it again :

group a starts the matrix until the 30 elements and then group b until the 60 and then group a until the 90 and the group b until the 120 on.

I found a way here in the forum after search of extracting the six element every time but I could not figure out how to do what I want ..
var = MyMatrix (:5:end, 2);

Thanks in advance

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.