mergeCells
Description
h = mergeCells(g,cellIDs)g by removing their shared faces.
          cellIDs must be a vector of two cell IDs. The specified cells must
        share at least one face.
mergeCells renumbers cells, faces, edges, and vertices in the
        resulting geometry. The merged cell gets the first of the specified cell IDs. The function
        decreases all cell IDs following the second of the specified cell IDs by 1. Because
          mergeCells removes shared faces, it also removes edges and vertices
        belonging only to these faces and decreases IDs of all subsequent faces, edges, and
        vertices.
Examples
Input Arguments
Output Arguments
Tips
- While - mergeCellsremoves shared faces of the merged cells, it does not merge faces of the merged cell. So, the resulting geometry can have extraneous faces. For example, if you merge two stacked cubes,- mergeCellsremoves the face between the cubes,but each side of the merged cell consists of two faces, not one face, for a total of 10 faces in the merged geometry.
- Merging modifies a geometry, but it does not modify the mesh. After merging cells, call - generateMeshfor a proper mesh association with the new geometry.
Version History
Introduced in R2023b

