Error in s2rlgc
6 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Debraj Bhattacharjee
on 17 Jun 2019
Edited: Debraj Bhattacharjee
on 17 Jun 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.
0 Comments
See Also
Categories
Find more on Data Import and Network Parameters in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!