Error in s2rlgc

17 visualizzazioni (ultimi 30 giorni)
Brian
Brian il 24 Gen 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.

Risposte (1)

Debraj Bhattacharjee
Debraj Bhattacharjee il 17 Giu 2019
Modificato: Debraj Bhattacharjee il 17 Giu 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.

Categorie

Scopri di più su Data Import and Network Parameters in Help Center e File Exchange

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by