title: Using vector as range in for-loop In Matlab
body: <p>I was wondering what the rule is for using vectors as range in for-loop in Matlab? </p>
  
  <p>For example,</p>
  
  <pre><code>range = [0.1:0.01:2]'; % wrong
  range = [0.1:0.01:2]; % correct
  
  for i = range
  i
  end
  </code></pre>
  
  <ol>
  <li>Why is it that if <code>range</code> is column vector, it will not work, while
  if <code>range</code> is row vector, it will?</li>
  <li>Will <code>i = range</code> be interpreted as <code>i</code> taking each value of <code>range</code>,
  or <code>i</code> is assigned with vector <code>range</code>?</li>
  </ol>
  
  <p>Thanks~</p>