Error in s2rlgc

10 vues (au cours des 30 derniers jours)
Brian
Brian le 24 Jan 2019
I think there is a bug in the s2rlgc code currently being distributed (or at least in 2018a). When you feed the function S parameters swept over frequency, the following error results:
Error in s2rlgc (line 129)
if any(isnan(R) || isnan(L) || isnan(G) || isnan(C))
I believe the intended effect of this line is properly obtained by changing it to:
if any(isnan(R)) || any(isnan(L)) || any(isnan(G)) || any(isnan(C))
since the || operator doesn't appear to work between arrays, nor automatically reduce the array of zeros to a single 0. By doing the any() first, then the || operator, the arrays are properly collapsed prior to the boolean operation.

Réponses (1)

Debraj Bhattacharjee
Debraj Bhattacharjee le 17 Juin 2019
Modifié(e) : Debraj Bhattacharjee le 17 Juin 2019
This is a bug in MATLAB R2019a when more than one set of s-parameters is used.
However, to work around this issue please follow the steps given below:
1. Create a function named "s2rlgc_modified.m", in which the line corrsponding to:
if any(isnan(R) || isnan(L) || isnan(G) || isnan(C))
is replaced with:
if any(isnan(R) | isnan(L) | isnan(G) | isnan(C))
The rest of the function is identical to "s2rlgc".
2. Please call the "s2rlgc_modified" function instead of the "s2rlgc" function.

Catégories

En savoir plus sur Data Import and Network Parameters dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by