title: How to add elements to a vector in matlab
body: <p>I've looked around on the internet a bit and cannot seem to find the answer to this question.  I want to declare a vector in matlab and then have a for loop that will add an element to the vector each time I go through the for loop.</p>
  
  <p>This is what I've tried and it doesn't seem to be working</p>
  
  <pre><code>vector[];
  
  for k = 1 ; 10
  %calculate some value
  %calculated value stored in temp variable
  vector(k) = temp;
  end
  </code></pre>
  
  <p>This does not work. Does anybody know how to solve this issue?</p>