title: How to create cell-array in MATLAB and initialize all elements to the same object?
body: <p>I have a matrix (call it <code>X</code>) that is initialized to say <code>zero(3)</code>.</p>
  
  <p>I want to change the code so that <code>X</code> is a cell array of size (say) <code>(3,1)</code> and initialize each element to <code>zero(3)</code>.</p>
  
  <p>I can do it with a loop but is there a better way?</p>
  
  <pre><code>X = cell(3,1);
  for ii=1:numel(X)
      X{ii} = zeros(3);
  end
  </code></pre>