January 31, 2024 at 12:27 pm
Afroditi Petropoulou
Ansys Employee
Dear Jing,
A small correction. Use this script:
n=8;
T=getresult("AWG","T");
lambda=T.lambda;
Tres=matrix(n,length(lambda));
for (i=1:n) {
Tres(i,:)=T.getattribute("T"+num2str(i));
plot(lambda*1e9,pinch(Tres,1,i),"lambda", "T");
holdon;
}
leg=cell(n);
y=linspace(1,n,n);
for (i=1:n){
leg{i}="Re(T"+num2str(y(i))+")";
}
legend(leg);
setplot("log10y",1);
setplot("y max",1);
setplot("y min",1e-7);
setplot("legend position",8);
holdoff;
The previous one will work as external script but will not work inside the analysis. Again if you want to use it in the analysis you need to remove the second line (T=getresult("AWG","T");). In this case, when you run the analysis, the results will be automatecally plotted.
Best regards,
Afroditi