title: MATLAB: get equally spaced entries of Vector
body: <p>How would it be possible to get equally spaced entries from a Vector in MATLAB, e.g. I have the following vector:</p>
  
  <pre><code> 0    25    50    75   100   125   150
  </code></pre>
  
  <p>When I chose <code>2</code> I want to get:</p>
  
  <pre><code>0   150
  </code></pre>
  
  <p>When I chose <code>3</code> I want to get:</p>
  
  <pre><code>0   75   150
  </code></pre>
  
  <p>When I chose <code>4</code> I want to get:</p>
  
  <pre><code>0   50   100   150
  </code></pre>
  
  <p>Chosing <code>1</code>, <code>5</code> or <code>6</code> shouldn't work and I even need a check for an <code>if</code>-clause for that but I can't figure this out. </p>