title: how to edit cells array in matlab
body: <p>I have this cells array which is came from a mat lab code that generates dewey IDs:</p>
  
  <pre><code> POT1 = 
  
          'a0'      []      []      []
          'a0'    'c0'      []      []
          'a0'    'b0'      []      []
          'a0'    'c1'      []      []
          'a0'    'd0'      []      []
          'a0'    'c0'    'd1'      []
          'a0'    'b0'    'd2'      []
          'a0'    'd0'    'd3'      []
          'a0'    'd0'    'c2'      []
          'a0'    'd0'    'b1'      []
          'a0'    'd0'    'd4'      []
          'a0'    'c1'    'c3'      []
          'a0'    'c1'    'b2'      []
          'a0'    'c1'    'c3'    'd5'
          'a0'    'c1'    'b2'    'd6'
          'a0'    'd0'    'b1'    'd7'
          'a0'    'd0'    'c2'    'd8'
  </code></pre>
  
  <p>note that column 1 is parent of column 2 and column 2 is paret of column 3..etc</p>
  
  <p>so I want to build a code that gives the full name of each cell as follow:</p>
  
  <p>POT1 = </p>
  
  <pre><code>  a0      []       []          []
    a0    a0.c0      []          []
    a0    a0.b0      []          []
    a0    a0.c1      []          []
    a0    a0.d0      []          []
    a0    a0.c0    a0.c0.d1      []
    a0    a0.b0    a0.b0.d2      []
    a0    a0.d0    a0.d0.d3      []
    a0    a0.d0    a0.d0.c2      []
    a0    a0.d0    a0.d0.b1      []
    .
    .
    .
    .     
  </code></pre>
  
  <p>The code which I build is not complete and gives me :" Index exceeds matrix dimensions" error :</p>
  
  <pre><code>for i=1:length(POT1)
        for j=3:size(POT1,2)
            if ~isempty(POT1{i,j})
            POT1{i,j}=[POT1{i,j-2} POT1{i,j-1} POT1{i,j}];
            end
        end
    end
    POT1
  </code></pre>