Contenido principal

importFromJson

R2026b

Import Topology object from JSON file

Since R2026b

Description

customTopology = importFromJson(filename) imports a Topology object from the specified JSON file, filename. The filename argument is a character vector or string scalar that specifies the name of the JSON file with the .json extension.

example

Examples

collapse all

Follow the steps in Save Custom Topology to JSON File to create a JSON file named "pouchLayout.json".

Then, load the topology from the JSON file.

loadedTopology = simscape.battery.builder.Topology.importFromJson("pouchLayout")
loadedTopology = 

  Topology with properties:

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

Show all properties

Input Arguments

collapse all

Name of the JSON file that contains the Topology object to import, specified as a character vector or string scalar.

Output Arguments

collapse all

Custom topology imported from JSON file, returned as a Topology object.

Version History

Introduced in R2026b