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.