title: MATLAB: Resize a vector using a Conditional
body: <p>I have three vectors: state, position, and index. Each has 50 elements. I am trying to produce a graph for position vs. index, but only if the values of state are from 2 to 5. For example, for the data:</p>
  
  <p>0 13 3</p>
  
  <p>2 24 1</p>
  
  <p>1 18 2</p>
  
  <p>5 71 0</p>
  
  <p>I would like the code to only graph the points for the second and fourth lines (since the state is between 2 and 5) for values 24,1 and 71,0. </p>
  
  <p>Any help is greatly appreciated!</p>