Accessing vectors in blocks

Accessing with regular steps

Example

>> V

V =

     1     2     3     4     5     6

>> V(1:4)

ans =

     1     2     3     4

>> V(2:4)

ans =

     2     3     4

Accessing in the steps of N

We may access matlab vectors in the steps of n as :

>> V(2:2:end) % V(starting index, increment to steps, till the end of vector)

ans =

     2     4     6