Invert order of nested cell arrays in Matlab
<p>I would like to know if it is possible to invert the order of nested cell arrays in Matlab.</p>

<p>If I have a cell array
<code>A{a,b}{c,d}</code>
is there a way to convert it into
<code>B{c,d}{a,b}</code>
?</p>

<p>The aim is to get
<code>C={c,d}(a,b)</code>
to be able to sum over a and later over b.</p>

<p>If I do
<code>C=cellfun(@cell2mat, A, 'UniformOutput', false);</code>
then C will have a shape <code>C{a,b}(c,d)</code>, which doesn't help me further. </p>

<p>I would appreciate any help, tips or comments. </p>

<p>Anna</p>