We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.

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.

Â