title: How to calculate the number of rows in a Cell array in MATLAB
body: <p>I want to calculate the number of rows in a Cell array in MATLAB.
  I use the code below to count the number of columns in a cell array but I do not know its way for counting the rows.</p>
  
  <pre><code>filledCells = ~cellfun(@isempty,a);
  columns = sum(filledCells,2)
  </code></pre>
  
  <p>As an example, i've got x as a cell array:</p>
  
  <pre><code>x =     [5]    [1x8 double]    [5]
  </code></pre>
  
  <p>This cell array has one row and three columns. I need a code to calculate the number of rows equal to "1" , but I did not find a way to calculate it.</p>