-
-
January 9, 2024 at 1:28 am
minusunny
SubscriberCMRR,Insertion loss, Imbalance, phase deviation T1 = getresult("FDTD::ports::Out1","T"); lambda1 = T1.lambda; T2 = getresult("FDTD::ports::Out2","T"); lambda2 = T2.lambda; T3 = getresult("FDTD::ports::Out3","T"); lambda3 = T3.lambda; T4 = getresult("FDTD::ports::Out4","T"); lambda4 = T4.lambda; I = -20*log10(abs(T1-T4)/abs(T1+T4)); Q = -20*log10(abs(T2-T3)/abs(T2+T3));
 When i try to run this code i am getting error ' arguments of - are not the same type or of an invalid type' at the last two lines.May i know the reason why? -
January 10, 2024 at 8:44 am
Afroditi Petropoulou
Ansys EmployeeDear Minu,
Thank you for contacting us!
The reason you get this error is because when you use theÂ
getresult("FDTD::ports::Out1","T");
script command, the obtained T1, T2, T3 and T4 are matrix datasets and you cannot do calculations with datasets, only with matrices. When you run the script you can see that in the Script Workspace as shown below:
If you want to calculate I and Q you need to get the transmission matrices from these datasets, the same way you got the lambda matrices:
T1_result = T1.T;
T2_result = T2.T;Â .... and so on.
Then you can calculate I and Q as:
I = -20*log10(abs(T1_result-T4_result)/abs(T1_result+T4_result));
Q = -20*log10(abs(T2_result-T3_result)/abs(T2_result+T3_result));
Best Regards,
Afroditi
-
Viewing 1 reply thread
- The topic ‘arguments of – are not the same type or of an invalid type’ is closed to new replies.
Ansys Innovation Space
Trending discussions
Top Contributors
-
3872
-
1414
-
1241
-
1118
-
1015
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.