title: How to find cell partitions can be accessed from a partition in MATLAB?
body: <p>I have a cell partition like <code>A={{1} {2 3 4} {5}}</code>. I should find all partitions can be accessed from this partition by merging some cells into one cell or splitting a cell into some cells. </p>
  
  <p>For partition A, the results partitions are:</p>
  
  <ul>
  <li>parttions obtains by merging the cells:<br>
  <code>{{1 2 3 4}{5}}, {{1 5}{2 3 4}}, {{1} {2 3 4 5}} {{1 2 3 4 5}}</code></li>
  <li>parttions obtains by splitting a cell:<br>
  <code>{{1}{2}{3 4}{5}}, {{1}{3}{2 4}{5}}, {1}{4}{2 3}{5}},{{1}{2 3}{4}{5}}, {{1}{2 4}{3}{5}},{{1}{2}{3 4}{5}}</code></li>
  </ul>
  
  <p>I know for finding the accessible partitions by the merge action, I should find all combination k of |A| of cells, where <code>2&lt;=k&lt;=|A|</code>.</p>
  
  <p>But, I don't know how to find all partitions can be formed by splitting.</p>
  
  <p>How can I do this?
  Thank you</p>