Convert RLGC transmission line parameters to Sparameters
s_params = rlgc2s(R,L,G,C,length,freq,z0)
s_params = rlgc2s(R,L,G,C,length,freq)
s_params = rlgc2s(R,L,G,C,length,freq,z0)
transforms
RLGC transmission line parameter data into Sparameters.
s_params = rlgc2s(R,L,G,C,length,freq)
transforms
RLGC transmission line parameter data into Sparameters with a reference
impedance of 50 Ω.

The output is a 2Nby2NbyM array of Sparameters. The following figure describes the port ordering convention of the output.
This port ordering convention assumes that:
To reorder ports after using this function, use the 
The following figure illustrates the RLGC transmission line model.
The representation consists of:
The distributed resistance, R, of the conductors, represented by a series resistor.
The distributed inductance, L, represented by a series inductor.
The distributed conductance, G,
The distributed capacitance, C, between the two conductors, represented by a shunt capacitor.
RLGC component units are all per unit length Δx.
Convert RLGC transmission line parameters into Sparameters:
%Define transmission line variables length = 1e3; freq = 1e9; z0 = 50; R = 50; L = 1e9; G = .01; C = 1e12; % Calculate Sparameters s_params = rlgc2s(R,L,G,C,length,freq,z0)
Bhatti, A. Aziz. "A computer Based Method for Computing the NDimensional Generalized ABCD Parameter Matrices of NDimensional Systems with Distributed Parameters." Southeastern Symposium on System Theory. SSST, 22nd Conference, 11–13 March 1990, pp. 590–593.