for with index matlab code example
Example: matlab for indexing
v(3:7) % Extract the third through the seventh elements
ans =
9 4 2 11 7
v(3:7) % Extract the third through the seventh elements
ans =
9 4 2 11 7