title: Deleting Empty cell arrays
body: <p>I have created cell arrays and put values using the loop.. Here is what I have done:</p>
  
  <pre><code>mycell =cell(1,100,num);       %% assume num anything
  idx = 1;
  [a,b] = size(depth);
  for i=1:a
   for j=1:b
        if isfinite(depth(i,j)) 
        for segId=1:2
          mycell{:,idx,segId} = depth(i,j);
          idx=idx+1;
  </code></pre>
  
  <p>In the end i got result like this:</p>
  
  <pre><code>mycell(;,:,1) = 
  [1] [1.2] [1.222] [] [] [] [0.7] [06] [] [0.34] .....[100n]
  
  mycell(;,:,2) = 
  [] [] [] [1.33] [0.5] [0.3] [] [] [0.5] [] .....[100n]
  </code></pre>
  
  <p>Is there any way I can delete the empty cell in these cell arrays...</p>
  
  <p>Or is there any way I can get an output like this: - 
  [1*9 values][1*88 values] and so on... like on cell array and get values in one cell...I am unable to do this because of this loop.</p>