Please enable JavaScript to view this site.

Knowledge Base

Saves data to a JSON file.

 

Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 

Syntax

Description

jsonsave("filename");

Saves all data in workspace to a JSON file using the explicit Lumerical Cell and Matrix Option 1 notation. For detailed information on the notations, please see the page JSON files.

jsonsave("filename", [var1, var2, ...]);

Saves the specified data variables to a JSON file using the explicit Lumerical Cell and Matrix Option 1 notation. For detailed information on the notations, please see the page JSON files.

Example

The following code example shows how to save the data in Lumerical workspace to a JSON file.

# Create variables a and b

a = 1;

b = [1+2i, 3+4i];

jsonsave("test_json.json");

 

Data in the "test_json.json" file:

{

  "a" : 1,

  "b" : 

  {

    "_complex" : true,

    "_data" : [ 1, 2, 3, 4 ],

    "_size" : [ 1, 2 ],

    "_type" : "matrix"

  }

}

 

See Also

jsonload, JSON files

Copyright Lumerical Inc. | Privacy | Site Map