Ansys Learning Forum › Forums › Discuss Simulation › Photonics › Data Extraction and Graph Drawing in var FDTD › Reply To: Data Extraction and Graph Drawing in var FDTD
Hi Subscriber,Â
Thank you for reaching out to us!
I believe the error occurs because T is a "dataset" type data.
With the following icon:
​
That is, T contains not only the transmission data but also the corresponded wavelength data.
Because log10 could only load matrix type data, this error occurs.
The solution is to load the matrix from the dataset.Â
More information about dataset.
You may try the following commands :Â
Trans = getresult("FDTD::ports::port 2", "T");
T_=Trans.T;Â Â Â Â Â Â # get transmission matrix from a dataset
Loss=-10*log10(T_);
f=Trans.f;Â Â Â Â Â Â Â # get frequency array
plot(c/f*1e6,Loss, "wavelength","dB");
Let me know if that helped.
Kind Regards,
Niki