Matlab loop to assign rows to cell array
<p>I have a big cell array <code>A=cell(a,b,c,d)</code> and a row vector <code>B</code> with dimensions <code>1</code>-by-<code>b</code>.</p>

<p>I want to build a loop in MATLAB that does the following:</p>

<pre><code>for i=1:n
   B = Calculate_row(input1,input2) %this is a function that creates my B row
   A{a,:,c,i} =  B(:)
end
</code></pre>

<p>anyway if I try to do <code>A{a,:,c} = B(:)</code> I receive the following error:</p>

<blockquote>
  <p>Expected one output from a curly brace or dot indexing expression, but there were b results.</p>
</blockquote>

<p>And if I try to do <code>A(a,:,c) = B(:)</code> I receive the following error:</p>

<blockquote>
  <p>Conversion to cell from double is not possible.</p>
</blockquote>

<p>Is there a way to do this? (I know a less elegant way that probably works would be to assign each value to the cell separately, but I would prefer not to do it).</p>