In many cases, users are dealing with complex data.
Using text files to export or import such data wouldn't be convenient.
Lumerical scripting allows to export data in binary file format, such as Lumerical Data
File (ldf) format, or matlab compatible file format.
The "savedata" command will save either all current variables in the workspace or the
specified variables into the specified ldf file.
The "loaddata" command will load the variables stored in the ldf file.
Note that when using "savedata" or "loaddata", you do not have to specify the file extension
In a similar way, the "matlabsave" command will save either all current variables in
the workspace or the specified variables into a Matlab compatible .mat file.
To load the data saved in a .mat file, you can use the "matlabload" command.
Note that you do not need to have a Matlab installed in your computer for "matlabsave"
and "matlabload" to work in Lumerical.
However, if you have a Matlab available, saving the data in this format will allow you to
use the Matlab for further post-processing.