 <p>You are trying to access the variable which is cell array in MATLAB. Are you sure the data are stored consequently? What happens if you put double array into the structure? </p> <pre><code>matrixStruct = struct('matrix', [4, 4, 4; 5, 5, 5; 6, 6 ,6]) </code></pre> <hr> <p>I think the problem is how MATLAB stores data in cell array. Try to run this:</p> <pre><code>double1 = 1; double2 = 1:2; cellempty = {[]}; celldouble1 = {1}; celldouble2 = {1:2}; cell2doubles = {1,2}; whos </code></pre> <p>The output:</p> <pre><code>Name Size Bytes Class Attributes cell2doubles 1x2 136 cell celldouble1 1x1 68 cell celldouble2 1x1 76 cell cellempty 1x1 60 cell double1 1x1 8 double double2 1x2 16 double </code></pre> <p>You can see that each element of cell array occupy additional 60 bytes to the size of numbers. </p>