主要内容

clearCellCenterPositions

R2026b

Clear X and Y coordinates of CellCenterPositions in Topology object

Since R2026b

Description

customTopology = clearCellCenterPositions(customTopology) sets all X and Y coordinates in the CellCenterPositions property table of the Topology object, customTopology, to NaN. Use this method to reset the cell positions before specifying new positions.

example

Examples

collapse all

Create a battery cell with cylindrical geometry.

myCell = batteryCell(batteryCylindricalGeometry);

Define cell center positions as a table with X and Y coordinates.

positions = table( ...
    [0.02; 0.04; 0.08; 0.02; 0.04; 0.08], ...
    [0.02; 0.02; 0.02; 0.04; 0.04; 0.04], ...
    'VariableNames', ["X", "Y"]);

Create a custom topology using the specified cell positions.

customTopology = simscape.battery.builder.Topology(...
    NumParallelCells=3, ...
    NumSeriesAssemblies=2, ...
    BatteryCell=myCell, ...
    CellCenterPositions=positions)
customTopology = 

  Topology with properties:

                   Name: "PouchLayout"
       NumParallelCells: 4
    NumSeriesAssemblies: 1
            BatteryCell: [1×1 simscape.battery.builder.Cell]
    CellCenterPositions: [4×4 table]

Show all properties

Examine the table in the CellCenterPositions property.

customTopology.CellCenterPositions
ans =

  6×4 table

     X       Y      CellID    ParallelAssemblyID
    ____    ____    ______    __________________

    0.02    0.02      1               1         
    0.04    0.02      2               1         
    0.08    0.02      3               1         
    0.02    0.04      1               2         
    0.04    0.04      2               2         
    0.08    0.04      3               2   

Clear the X and Y coordinates of the Topology object and examine the CellCenterPositions property table again.

customTopology = clearCellCenterPositions(customTopology);
customTopology.CellCenterPositions
ans =

  6×4 table

     X      Y     CellID    ParallelAssemblyID
    ___    ___    ______    __________________

    NaN    NaN      1               1         
    NaN    NaN      2               1         
    NaN    NaN      3               1         
    NaN    NaN      1               2         
    NaN    NaN      2               2         
    NaN    NaN      3               2   

Input Arguments

collapse all

Custom topology to modify, specified as a Topology object.

Version History

Introduced in R2026b