Ansys Learning Forum Forums Discuss Simulation Photonics Exporting a large number of data sets into TXT from varFDTD Reply To: Exporting a large number of data sets into TXT from varFDTD

Guilin Sun
Ansys Employee

Simple methods to save data into a file are:


matlabsave in .mat format;matlabsave - Script command

savedata in ldf format savedata - Script command

If you really want to save data in txt format, you will need to specify the data, eg

write(fileName, num2str(data.E(i,j,k,m)), "overwrite");

or one line have all the data along one axis, say x (which has fewer data):

write(fileName, num2str(data.E(1:nx,j,k,m)),"overwrite");

where

x=data.x;

nx=length(x)

I strongly suggest to use the standard, simple methods to save and load the data instead of txt format.

Â