title: Vector of objects in Matlab without knowing dimension
body: <p>I have this code:</p>
  
  <pre><code>allObjects=[]
  for i=1:100
     allObjects(end+1) = MyObject();   % push the object to the end of my vector
  end
  </code></pre>
  
  <p>But this prints:</p>
  
  <blockquote>
    <p>Conversion to double from MyObject is not possible.</p>
  </blockquote>
  
  <p>Same thing if i declare allObjects as a cell array</p>
  
  <pre><code> allObjects = {}
  </code></pre>
  
  <p>How can I have a vector of objects in Matlab, consider I can't know how many objects I will need to store?</p>